all groups > sql server replication > july 2005 >
You're in the

sql server replication

group:

track local server name in replication setup


track local server name in replication setup Jens
7/20/2005 12:02:50 PM
sql server replication:
Hi
I am going to use the basic code in the vb.net sample in Hilarys Cotter
book. to set up subscribers.
Only thing that puzzles me, is that each client probably will have different
names.
I tried to different types of names in the strSubscriber like:
strSubscriber="(Local)"
strSubscriber="<Local>"
strSubscriber="[Local]"
all these give an error in oMerge.Addsubscribtion(....)
Just for the record, using my real server name everything works fine.
Is there a way to detect the local SQL servename?

Jens..



Re: track local server name in replication setup Hilary Cotter
7/21/2005 9:44:50 AM
Simple answer is no, because the methods I know of are not aware of
instances.

for the local machine name which will work for the default named instance
look at

System.Environment.MachineName

HTH
--
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
[quoted text, click to view]

AddThis Social Bookmark Button