动态sql 读取变量

declare @maxSort int=0 set @sqlUpdateSort='select @maxSort=max(Display_Sequence'+@categoryRow+') from tblMENU_ITEMS where category'+@categoryRow+'='''+@cagegory+''' and item_id>0' exec sp_executesql @sqlUpdateSort,N'@maxSort int output',@maxSort output
posted @ 2017-03-05 00:00  PhilXu  阅读(138)  评论(0编辑  收藏  举报