社区
MS-SQL Server
帖子详情
有关select @var 在exec () 中 的模梭两可的问题,急
tofool
2003-05-20 09:55:15
declare @code int
select @code=-1
select @sql='select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null '
print @sql
exec(@sql)
注:所有的变量都有定义。
它提示的错误信息是:必须定义@code 。
我想有什么办法 达到 我想要的结果??! 换一个方法也行!
...全文
102
7
打赏
收藏
有关select @var 在exec () 中 的模梭两可的问题,急
declare @code int select @code=-1 select @sql='select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null ' print @sql exec(@sql) 注:所有的变量都有定义。 它提示的错误信息是:必须定义@code 。 我想有什么办法 达到 我想要的结果??! 换一个方法也行!
复制链接
扫一扫
分享
转发到动态
举报
AI
作业
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
tofool
2003-05-20
打赏
举报
回复
请问,sp_executesql 是不是任何角色,都可以使用??
还是只有admin 角色才能使用!?
happydreamer
2003-05-20
打赏
举报
回复
要用sp_executesql exec不支持动态输出
愉快的登山者
2003-05-20
打赏
举报
回复
declare @code int
select @code=-1
select @sql=N'select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null '
execute sp_executesql
@sql,
N'@code int output',
@code = @code output
select @code
pengdali
2003-05-20
打赏
举报
回复
declare @code int,@sql nvarchar(4000)
select @code=-1
select @sql='select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null '
print @sql
exec sp_executesql @sql,N'@code int output',@code output
select @code
pengdali
2003-05-20
打赏
举报
回复
declare @code int,@sql nvarchar(4000)
select @code=-1
select @sql='select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null '
print @sql
exec sp_executesql @sql,N'@code int output',@code output
select @code
firetoucher
2003-05-20
打赏
举报
回复
select @sql='
declare @code int
select @code=-1
select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null '
print @sql
exec(@sql)
pengdali
2003-05-20
打赏
举报
回复
declare @code int
select @code=-1
select @sql='select @code=code from '+@tablename+' where '+ ltrim(rtrim(@field))+' is null '
print @sql
exec sp_executesql @sql,N'@code int output',@code output
select @code
alertmanager集群莫名发送resolve消息的
问题
探究
最近遇到了一个alertmanager HA集群莫名发送告警恢复消息的
问题
。简单来说就是线上配置了一个一直会产生告警的规则,但却会收到alertmanager发来的告警恢复消息,与预期不符。所使用的告警架构如下,vmalert产生的告...
[Golang]Gin框架及MySql数据库重要函数汇总
以上函数是我在搓学管和留言板时用到的函数,gin框架封装了很多很好的函数我并没有用上。这里只占很小一部分。这篇文章相当一部分内容引用了ai的回答。这篇文章主要是留下为我日后复习做准备。写了
两
个小时终于写完...
转大神的日志 【大杂烩】杂7杂8的东西
工作上暂时没有安排,可以先看看资料,早上把iptables重新看了一下,整理了一下链和表的关系,并且在MR3080上进行了实验。 2013.8.27 项目移交整理,发现很多项目的状态不清楚,平时要注意整理啊。 ...
【大杂烩】杂7杂8的东西
上午组内预答辩,下午处理项目安排,移植IPv6到741,发现,模块耦合太大,在4900上没有考虑功能的可插拔性,没有做好模块独立,在移植过程
中
需要考虑这个
问题
并做好模块独立; 2013.11.22 周五 先记录...
性能之巅节选
在上面的输出
中
,在运行队列(r)
中
有
两
个进程在等待 CPU 并有零个休眠进程(b)。通常,它不应该超过处理器(或核心)的数量,如果你发现异常,最好使用 top 命令进一步地排除故障。 r:等待运行的进程数。 b:休眠...
MS-SQL Server
34,838
社区成员
254,631
社区内容
发帖
与我相关
我的任务
MS-SQL Server
MS-SQL Server相关内容讨论专区
复制链接
扫一扫
分享
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章