日期:2014-05-17 浏览次数:20707 次
declare @id nvarchar(10)='12'
declare @sql1 nvarchar(2000)='DECLARE @ProgramIDs table([ProgramID] [int]) insert into @ProgramIDs select '+@id
exec (@sql1)
print @@rowcount --这个在下面要使用
declare @sql2 nvarchar(2000)='select ProgramID from @ProgramIDs'
exec (@sql2)
declare @id nvarchar(10)='12'
declare @sql1 nvarchar(2000)=' select '+@id
exec (@sql1)
print @@rowcount --这个在下面要使用
declare @sql2 nvarchar(2000)='DECLARE @ProgramIDs table([ProgramID] [int]) insert into @ProgramIDs select '+@id+' select ProgramID from @ProgramIDs'
exec (@sql2)