今天在做一个非常奇葩的东西。中间有个过程要在SQL触发器里面调用webservice接口。呵呵~
ALTER TRIGGER tgr_UpdateMemcached
ON dbo.[User]
AFTER UPDATE
AS
--获得更新前的数据
--SELECT * FROM Deleted AS OldData
--获得更新后的数据
--SELECT * FROM Inserted AS NewData
--调用webService----------------
declare @ServiceUrl as nvarchar(1000)
DECLARE @UrlAddress nvarchar(500)
--WebService地址:以http开头,结尾带斜杠。比如'http://webservice.webxml.com.cn/WebServices/MobileCodeWS.asmx/'
set @UrlAddress = 'http://localhost/webService_UpdateCache/WebService1.asmx'
DECLARE @FunName nvarchar(50)--WebService中调用的方法名:比如'getMobileCodeInfo'
SET @FunName = 'UpdateCache'
--以下參数相应WebService中4个參数的[參数名]
declare @UserCode nvarchar(36),@UserName nvarchar(36),@UserAge nvarchar(36)
SET @UserCode=