Network database,
The exec sp_addlinkedserver 'srv_lnk', ' ', 'SQLOLEDB', 'IC01'
The exec sp_addlinkedsrvlogin 'srv_lnk', 'false', null, 'sa', '123456'
How the statements to judge whether the connection is successful?
After the connection is successful
USE the
The ALTER DATABASE
How do you write behind these statements?
CodePudding user response:
http://blog.csdn.net/yenange/article/details/77234688
CodePudding user response:
ALTER DATABASE the DDL using the AT grammar to write, reference to the online help
E.g.
EXECUTE (' SELECT ProductID, Name The FROM AdventureWorks2012. Production. The Product ') AT the link server name; Determine if the connection is successful, directly SELECT a system object, use begin a try...
CodePudding user response:
refer to the second floor roy_88 response: ALTER DATABASE the DDL using the AT grammar to write, reference to the online help E.g. EXECUTE (' SELECT ProductID, Name The FROM AdventureWorks2012. Production. The Product ') AT the link server name; Determine if the connection is successful, directly SELECT a system object, use begin a try... 2008 is not an AT CodePudding user response:
SQL2008 support AT, in the online help to find the EXECUTE usage CodePudding user response:
With reference to the grammar, and finally an instance https://msdn.microsoft.com/zh-cn/library/ms188332 (SQL. 105). Aspx CodePudding user response:
The refer to the original poster beadly response: network database, The exec sp_addlinkedserver 'srv_lnk', ' ', 'SQLOLEDB', 'IC01' The exec sp_addlinkedsrvlogin 'srv_lnk', 'false', null, 'sa', '123456' How the statements to judge whether the connection is successful? After the connection is successful USE the The ALTER DATABASE How do you write behind these statements? You this is to establish a link to the server, set up good, after can query language sentence, the select * from [srv_lnk] [dbname]. [dbo] [table] CodePudding user response:
http://blog.csdn.net/yenange/article/details/77234688 CodePudding user response:
refer to 6th floor z10843087 response: Quote: refer to the original poster beadly response: Network database, The exec sp_addlinkedserver 'srv_lnk', ' ', 'SQLOLEDB', 'IC01' The exec sp_addlinkedsrvlogin 'srv_lnk', 'false', null, 'sa', '123456' How the statements to judge whether the connection is successful? After the connection is successful USE the The ALTER DATABASE How do you write behind these statements? You this is to establish a link to the server, set up good, after you can query language sentence, the select * from [srv_lnk] [dbname]. [dbo] [table] What I need is how to modify the database, not query data table data, CodePudding user response:
Bosses how to connect to the local computer network database