时间:2021-07-01 10:21:17 帮助过:129人阅读
简单通用的数据 置顶、上移、下移 sql 存储过程 CREATE procedure [dbo].[UpdateTabelDataOrder]output--和本数据相邻的上一条OrderboardId declare ,@id output,@upid top(select from ' +quotename(@tablename) +' where )) 'print @sql_8exec sp_executes
简单通用的数据 置顶、上移、下移 sql 存储过程
CREATE procedure [dbo].[UpdateTabelDataOrder]output--和本数据相邻的上一条OrderboardId declare ,@id output,@upid top(select from ' +quotename(@tablename) +' where < ))' print @sql_8 exec sp_executesql @sql_8 set @sql_8='update '+quotename(@tablename)+' set = 1 where = @upid' exec sp_executesql @sql_8, as int', @upid = @columnvalue if @@error<>0 begin rollback tran end else begin commit transaction end end else --恢复@@trancount初始值,,处理@@trancount bug begin commit transaction end end
posted on
Copyright ©2013 porray Powered By: 博客园 模板提供:沪江博客