您当前的位置: 首页 > 

暂无认证

  • 0浏览

    0关注

    101061博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

where in 加变量问题

发布时间:2010-12-23 08:28:00 ,浏览量:0

昨天一个网友问我这样一个问题:

declare @si_names nvarchar(200),@txt nvarchar(4000),@sql as nvarchar(4000) set @si_names='(''0'',''fcly'',''啦啦啦'',''我爱Home'')'

insert into ShopEmail(si_id,se_friend,se_title,se_content,se_time,se_state,se_isend,se_sendel,se_isdraft) select '3',id,'测试一下邮箱功能','添加内容:测试一下邮箱功能,请好好配合哦!',Getdate(),'0','1','0','0' from ShopInfo where si_name in @si_names 却是报错误

insert into ShopEmail(si_id,se_friend,se_title,se_content,se_time,se_state,se_isend,se_sendel,se_isdraft) select '3',id,'测试一下邮箱功能','添加内容:测试一下邮箱功能,请好好配合哦!',Getdate(),'0','1','0','0' from ShopInfo where si_name in ('0','fcly','啦啦啦','我爱Home') 却是OK的

我想到以前我是用动态T-SQL处理的

关注
打赏
1655516835
查看更多评论
立即登录/注册

微信扫码登录

0.4216s