exec sp_addlinkedserver 'linkserver','','SQLOLEDB','192.168.1.200' EXEC sp_addlinkedsrvlogin 'linkserver','false',NULL,'sa','123456' select * from linkserver.TestDB.dbo.TestTable Exec sp_droplinkedsrvlogin linkserver,Null Exec sp_dropserver linkserver
查询该数据库下所有表名称
SELECT NAME FROM linkserver.HXPortal.dbo.SYSOBJECTS WHERE TYPE='U'
数据库、表名
SELECT * FROM INFORMATION_SCHEMA.TABLES