Script Link Server in SQL Server 2005

Posted: Tuesday,April 7, 2009 in SQL 2005
Tags: , , , ,

— Drop Server

EXEC master.dbo.sp_addlinkedserver
@server = N’NameServer’
,@srvproduct=N’SQL Server’

–Add Server

Exec sp_addlinkedsrvlogin @rmtsrvname =’NameServer’
, @useself = ‘FALSE’
, @locallogin = null
, @rmtuser =’Username’
, @rmtpassword = ‘Password’

Use this query to test the link server correct and active :

Select * From [NameServer].DatabaseName.dbo.TableName

 

Have A Nice Try…

Regards,

Wihemdra

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s