寒 寒战 Unregistered / Unconfirmed GUEST, unregistred user! 2008-07-07 #1 declare @SQl varchar(100)<br>N'<br>set '''+@sql+''' = '' flat=0''<br><br>select * from PP20080406161702123 where' +@sql<br>请问这个语句应该怎么改?
declare @SQl varchar(100)<br>N'<br>set '''+@sql+''' = '' flat=0''<br><br>select * from PP20080406161702123 where' +@sql<br>请问这个语句应该怎么改?
寒 寒战 Unregistered / Unconfirmed GUEST, unregistred user! 2008-07-07 #2 怎么没人回答,我就是想知道N后面定义的变量在后来的语句中怎么使用<br>比如<br>declare UserName VarChar(20)<br>N' declare @Flt varchar(100)<br> set @Flt='' and FValue=0 ''<br>select * from PP where FName='''+UserName+''' + @Flt 就是在这里把后面的条件加上去
怎么没人回答,我就是想知道N后面定义的变量在后来的语句中怎么使用<br>比如<br>declare UserName VarChar(20)<br>N' declare @Flt varchar(100)<br> set @Flt='' and FValue=0 ''<br>select * from PP where FName='''+UserName+''' + @Flt 就是在这里把后面的条件加上去
F ftlifeng Unregistered / Unconfirmed GUEST, unregistred user! 2008-07-08 #3 declare<br> @sql varchar(1000)<br><br>set @sql='flat=0'<br>set @sql='select * from PP20080406161702123 where '+@sql<br>exec(@sql)
declare<br> @sql varchar(1000)<br><br>set @sql='flat=0'<br>set @sql='select * from PP20080406161702123 where '+@sql<br>exec(@sql)
C Corn3 Unregistered / Unconfirmed GUEST, unregistred user! 2008-07-08 #4 N的作用,就是把N后面的字符串转成nvarchar类型
C choosejing Unregistered / Unconfirmed GUEST, unregistred user! 2008-07-09 #5 但是如果你exec(@sql)中在@sql不定义nvarchar型也没有用