Friday, March 30, 2012
How to create second publisher record on the server?
What we are trying to accomplish is to be able to replicate from Sql Server 2000 to some laptops running MSDE across the internet. These laptops are NOT part of our domain. I have set up a publication to allow for anonymous pull subscriptions for transa
ctional replication. Everything works fine now...except that for my test I had to setup/configure the laptop with a Hosts and LMHosts file so that it could resolve the server's name from its fully qualified name. This will be a pain for us to implement
and deploy....as we will have hundreds of client machines connecting to our server. The problem has to do with a sql server table that stores the name of the server publisher & distributor.
I noticed (via the sql server profiler tool) that when replication begins, there is some intial login/handshaking that occurs and one of the principal commands that gets executed is something like: exec sp_helpdistpublisher N'ServerName'. This stored pr
oc queries the MSDistPublisher table in the MSDB database. The stored proc returns a single row of data which includes our server's name...as it has been setup...it's machine name. This table does not include (obviously) a record that has the server's fu
lly qualified domain name (ServerName.Domain.Com).
My question is: is there a way to add an additional row of data and use the fully qualified domain name?
thanks for any help.
- DW
in your application, can't you hard code the publisher name with the FQDN
for the publisher/distributor?
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"DW" <DW@.discussions.microsoft.com> wrote in message
news:62391DE0-137B-46EE-9024-9E679829FD84@.microsoft.com...
> Hello...
> What we are trying to accomplish is to be able to replicate from Sql
Server 2000 to some laptops running MSDE across the internet. These laptops
are NOT part of our domain. I have set up a publication to allow for
anonymous pull subscriptions for transactional replication. Everything
works fine now...except that for my test I had to setup/configure the laptop
with a Hosts and LMHosts file so that it could resolve the server's name
from its fully qualified name. This will be a pain for us to implement and
deploy....as we will have hundreds of client machines connecting to our
server. The problem has to do with a sql server table that stores the name
of the server publisher & distributor.
> I noticed (via the sql server profiler tool) that when replication begins,
there is some intial login/handshaking that occurs and one of the principal
commands that gets executed is something like: exec sp_helpdistpublisher
N'ServerName'. This stored proc queries the MSDistPublisher table in the
MSDB database. The stored proc returns a single row of data which includes
our server's name...as it has been setup...it's machine name. This table
does not include (obviously) a record that has the server's fully qualified
domain name (ServerName.Domain.Com).
> My question is: is there a way to add an additional row of data and use
the fully qualified domain name?
> thanks for any help.
> - DW
Friday, March 23, 2012
How to create categories tree with subcategories ?
Hi, I Have 2 tables. First name of this tables is news_categories with one record: News. Strucutre this table ID and name_categories Second name of this tables is news_subkategorie with two records : With country and with world. Strucutre ID_Subcategories and name_subcategories I will receve effects:
News
--With country
--With world
How i write in Select Command ?
SELECT [ID_subcategries], [Name_subcategories], [ID] FROM [db_subcategories], [db_categories] WHERE (??)
How do you connect categories and subcategories? Does db_subcategories have ID which says to which category that subcategory belongs?
If that is true, than:
SELECT db_categories.ID, [ID_subcategries], [Name_subcategories]FROM [db_subcategories], [db_categories]WHERE db_categories.ID = db_subcategories.IDOrder By 1Asc, 2Asc|||
Hi,
this is my conncetion in web.config:
<
connectionStrings><
addname="ConnectionString"connectionString="Data Source=FS_AMILO_2065;Initial Catalog=sklep.mdf;Integrated Security=True"providerName="System.Data.SqlClient" /></
connectionStrings>
I have in categories.aspx GridView I link to subcategories.asp
subcategories?id={0}
|||
You can use modification of above query to return all subcategories for given ID:
SELECT [ID_subcategries], [Name_subcategories]FROM [db_subcategories]WHERE db_subcategories.ID = @.catIDOrder By 1Asc, 2Asc
where you use @.catID to store supplied ID
|||ID is a ID from categories ?
I mustMust declare the scalar variable "@.ID".
So i go to Pramters and ID is a QuertyString and ??
sqlHow to create categories tree with subcategories ?
Hi, I Have 2 tables. First name of this tables is news_categories with one record: News. Strucutre this table ID and name_categories Second name of this tables is news_subkategorie with two records : With country and with world. Strucutre ID_Subcategories and name_subcategories I will receve effects:
News
--With country
--With world
How i write in Select Command ?
SELECT [ID_subcategries], [Name_subcategories], [ID] FROM [db_subcategories], [db_categories] WHERE (??)
That is not easy but the link below will take you in the right direction. Hope this helps.
http://www.yafla.com/papers/sqlhierarchies/sqlhierarchies.htm#Figure1
Wednesday, March 21, 2012
how to create an copy of a certain record except one specific column that must be different &
Hi
I have a table with a user column and other columns. User column id the primary key.
I want to create a copy of the record where the user="user1" and insert that copy in the same table in a new created record. But I want the new record to have a value of "user2" in the user column instead of "user1" since it's a primary key
Thanks.
try this:
insert into your_table ( user , field2 , field3 , ... )
select 'user2', field2 , field3, ....
from your_table
where user = 'user1'
|||I WANTED TO AVOID SPECIFYING ALL THE COLUMNS SINCE THERE ARE MANY COLUMNS.
THANKS.
|||Here is a little trick
in Query Analuzer Or SSMS press F8, this will display the Object Explorer
Drill down to the table that you need, click on the Columns folder (hold the button down) and drag it into the query window
Now all your columns will be listed in the query window, just exclude the one that you don;'t want
Denis the SQL Menace
http://sqlservercode.blogspot.com/
|||Beautiful trick thanks a lot for sharing ithow to create an copy of a certain record except one specific column that must be different
Hi
I have a table with a user column and other columns. User column id the primary key.
I want to create a copy of the record where the user="user1" and insert that copy in the same table in a new created record. But I want the new record to have a value of "user2" in the user column instead of "user1" since it's a primary key
Thanks.
try this:
insert into your_table ( user , field2 , field3 , ... )
select 'user2', field2 , field3, ....
from your_table
where user = 'user1'
|||I WANTED TO AVOID SPECIFYING ALL THE COLUMNS SINCE THERE ARE MANY COLUMNS.
THANKS.
|||Here is a little trick
in Query Analuzer Or SSMS press F8, this will display the Object Explorer
Drill down to the table that you need, click on the Columns folder (hold the button down) and drag it into the query window
Now all your columns will be listed in the query window, just exclude the one that you don;'t want
Denis the SQL Menace
http://sqlservercode.blogspot.com/
|||Beautiful trick thanks a lot for sharing itSunday, February 19, 2012
How to copy record from a table in a server to a diffrent server.
Hi all,
I have server1 and server2 having the same tables. I wanna copy tbl1 records in server1 to tbl1 table in server2. How can I accomplish this task?
Thank you in advance,
Use a query. This assumes you have permissions to both servers.
Code Snippet
INSERT INTO tbl1SELECT
Col1,
Col2,
Col3,
etc
FROM Server2.MyDatabase.dbo.tbl1
WHERE {criteria}