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'
上一篇:ODAC(V9.5.15) 学习笔记(十一)TOraEncryptor、TOraPackage和TOraAlerter


下一篇:FlexPaper+SWFTool+操作类=在线预览PDF(转)