declare @ChrFintid nvarchar(4000) --声明变量 set @ChrFintid=(select ChrFintid from serpjdjs where IntID=@IntID) --取得变量字符串值,其格式为 1,2,3,4 exec('update serverkk set Intstatus=''2'' where intid in('+@ChrFintid+')') --试试行不
根据xeqtr1982(ShaKa) 的方法,我采用如下语句则可以 declare @ChrFintid nvarchar declare declare @ChrFexe nvarchar(4000) ; -- 执行语句 set @ChrFexe='update serverkk set Intstatus=''2'' where intid in ('+@ChrFintid+')' exec (@ChrFexe) 再次感谢两位。
set @ChrFintid=(select ChrFintid from serpjdjs where IntID=@IntID) --取得变量字符串值,其格式为 1,2,3,4
exec('update serverkk set Intstatus=''2'' where intid in('+@ChrFintid+')')
--试试行不
declare @ChrFintid nvarchar declare
declare @ChrFexe nvarchar(4000) ; -- 执行语句
set @ChrFexe='update serverkk set Intstatus=''2'' where intid in ('+@ChrFintid+')'
exec (@ChrFexe)
再次感谢两位。