日期:2014-05-18 浏览次数:20524 次
--alter procedure tiaoshi declare @tablename nvarchar(80) declare @rowindex nvarchar(8) --as declare @sql varchar(8000) set @sql='declare @order table(sequence int, uut nvarchar(8) null) insert into @order --这个地方添加上列名sequence insert into @order select sequence from'+@tablename+' insert into @order values(' +@rowindex+ ',null) --允许null的列,可以不写 values(' +@rowindex+ ') select * from @order order by sequence' print @sql --拼接后的字符串,LZ最好print出来看看 --exec(@sql) --return