The original code:
Usestring007if exists(Select 1 fromsysobjectswhereId= object_id('k_v_test') andType= 'U') Drop Tablek_v_testGoCreate TableK_v_test (Temp varchar( -) not NULL, Autoidint Identity, Key_nvarchar( -) not NULL, Value_nvarchar( $) not NULL, constraintPk_k_v_testPrimary Key(autoid))GoInsert intoK_v_test (Temp, Key_,value_)Values('Temp','Key','value')Insert intoK_v_test (Temp, Key_,value_)Values('Temp','Key','value')Insert intoK_v_test (Temp, Key_,value_)Values('Temp','Age',' -')Insert intoK_v_test (Temp, Key_,value_)Values('Temp','Sex','male')Insert intoK_v_test (Temp, Key_,value_)Values('Temp','Birthday','1986-')Insert intoK_v_test (Temp, Key_,value_)Values('Temp','name','Zhang MoU')Insert intoK_v_test (Temp, Key_,value_)Values('Temp','Mobile Phone','18888888888')GoSelect * fromK_v_test
And then the Chinese that you see under execution will become '? ' .... and then I searched the next ... That is, when the insert, when the character is in Chinese, add 'N' to the front ... Sure enough ... For example:insert into k_v_test (tempvalues('temp ', N' age ','+ ')
。。。。
Now the code:
Usestring007if exists(Select 1 fromsysobjectswhereId= object_id('k_v_test') andType= 'U') Drop Tablek_v_testGoCreate TableK_v_test (Temp varchar( -) not NULL, Autoidint Identity, Key_nvarchar( -) not NULL, Value_nvarchar( $) not NULL, constraintPk_k_v_testPrimary Key(autoid))GoInsert intoK_v_test (Temp, Key_,value_)Values('Temp','Key','value')Insert intoK_v_test (Temp, Key_,value_)Values('Temp'N'Age',' -')Insert intoK_v_test (Temp, Key_,value_)Values('Temp'N'Sex'N'male')Insert intoK_v_test (Temp, Key_,value_)Values('Temp'N'Birthday','1986-')Insert intoK_v_test (Temp, Key_,value_)Values('Temp'N'name'N'Zhang MoU')Insert intoK_v_test (Temp, Key_,value_)Values('Temp'N'Mobile Phone','18888888888')GoSelect * fromK_v_test
GoDaddy space SQL Server database No way to insert Chinese