1
我的SQL程序添加参数动态SQL查询
SET @query='UPDATE '[email protected]+' SET auth_Date='''[email protected]+'''
,[email protected]
,authorized=1 WHERE '[email protected]+'[email protected];
IF(@@ERROR=0) SET @reVal=1 ELSE SET @reVal=-1'
EXECUTE sp_executesql @query, N'@reVal int OUTPUT',
@reVal,N'@AuthID int',@AuthID,N'@Id int',@Id
这里@AuthID是DATETIME,@AuthID和@Id为int
1)如何传递参数。 2)有错误就要 Conversion failed when converting date and/or time from character string.
谢谢它的工作。 :) – kbvishnu 2011-02-19 05:45:16