SQL 跨服务器数据库增、删、改、查(二)

--创建链接服务器 
exec sp_addlinkedserver   'jx3xxiednr3ucidf', ' ', 'SQLOLEDB', 'jx3xxiednr3ucidf' 
exec sp_addlinkedsrvlogin 'jx3xxiednr3ucidf', 'false',null, 'sa', 'Aa12345' 

--
INSERT INTO jx3xxiednr3ucid.yyg.dbo.T_Tabel_a  ([Name])VALUES('张慧')
--
DELETE jx3xxiednr3ucid.yyg.dbo.T_Tabel_a  WHERE [Name] = '张慧'     
--
UPDATE jx3xxiednr3ucid.yyg.dbo.T_Tabel_a  SET   [Name] = '陈秋水' WHERE Id = 4
--
SELECT * FROM jx3xxiednr3ucid.yyg.dbo.T_Tabel_a 

--删除链接服务器 
exec sp_dropserver  'jx3xxiednr3ucidf', 'droplogins' 

 

posted @ 2015-04-28 11:40  秋风过、枯叶落  阅读(177)  评论(0编辑  收藏  举报