使用 linked server update table
一般呼叫 linked server 可以用
select * from remserver.db.dbo.table 的方式執行。但是 update 卻不行。
藉由叫用 sp_executesql 預存程序從本機伺服器, 則遠端伺服器上執行查詢以更動態的方式, 例如:EXEC remserver.master.dbo.sp_executesql
@stmt = N'DELETE sometable WHERE col1 = 10 OR col1 = 20'
出處在此
select * from remserver.db.dbo.table 的方式執行。但是 update 卻不行。
藉由叫用 sp_executesql 預存程序從本機伺服器, 則遠端伺服器上執行查詢以更動態的方式, 例如:EXEC remserver.master.dbo.sp_executesql
@stmt = N'DELETE sometable WHERE col1 = 10 OR col1 = 20'
出處在此
0 Comments:
Post a Comment
<< Home