Home > Database > Mysql Tutorial > body text

简单通用的数据 置顶、上移、下移 sql 存储过程

WBOY
Release: 2016-06-07 17:39:11
Original
1963 people have browsed it

简单通用的数据 置顶、上移、下移 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 @@error0 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: 博客园 模板提供:沪江博客

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template