SQLserver nTextとvarcharは互換性がありません

780 ワード

データ型nTextとvarchar演算子equalsで互換性のない問題解決策
 1.          ,         ,     !       nText Text  ,             ,    ,  SQLserver2005    nvarchar(max)     2G   ,      nText   。

 2.  T-SQL   cast    convert   nText       :

 (1)    :

cast関数:update tb_test set cast([A] as nvarchar(max))='xxx'
convert関数:update tb_test set convert(nvarchar(max),[A])='xxx'
 (2)    :

       cast  :     insert into tb_test([A]) where cast(’xxx’ as nvarchar(max)) 

convert関数:insert into tb_test([A]) where convert(nvarchar(max),’xxx’)
 (3)    :

       cast  :     select * from tb_test where cast([A] as nvarchar(max))=’xxx’

       convert  :select * from tb_test where convert(nvarchar(255),test)=’xxx’