标签:
declare @sql nvarchar(2000)
declare @Sign_Count int
declare @tablename varchar(30)=‘SignUpSuccess.Record201605‘
DECLARE @IN_iUserDBID bigint=100051
DECLARE @IN_biSubMatchSerialNo varchar(255)=‘2016050403‘
set @sql=‘select @Sign_Count=count(1) from ‘+ @tablename +‘ where UserDBID=‘+convert(varchar(255),@IN_iUserDBID)+‘ and MatchSerialNo=‘+convert(varchar(255),@IN_biSubMatchSerialNo)+‘ and convert(date,QuitTime)=convert(date,getdate())‘
--select @sql
exec sp_executesql @sql, N‘@Sign_Count int out ‘, @Sign_Count out
标签:
原文地址:http://www.cnblogs.com/liu-shiliu/p/5549397.html