SQL语句中的一些参数如何用变量来代替?
可以采用exec方法declare @tempStr varchar(350)select @tempStr=''Update weekcount set [''+convert(varchar,@week)+'']=[''+convert(varchar,@week)+'']+1 where userid=''''''+replace(@user,'''''''','''''''''''')+''''''''exec(@tempStr)注意: 使exec不能返回一些变量的值,而且当前的变量值在exec的语句里无效.- 联系我们: QQ:82526114(技术) 411523648(客服) 237057746(财务)
- 电话:+86-762-4372098 邮箱:webmaster@814e.net,support@814e.net
- 粤ICP备05002242号 网监局备案:4403701910502
