可以采用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的語句里無效。
新聞熱點
疑難解答