开发者

collation in stored procedure

开发者 https://www.devze.com 2023-01-02 20:02 出处:网络
I have a table which contains data in different languages. All fields are nvarchar(max). I created a stored procedure which trim values of all the fields

I have a table which contains data in different languages. All fields are nvarchar(max). I created a stored procedure which trim values of all the fields

Create Proc [dbo].[TrimValues]
as
update testdata 
set city = dbo.trim(city),
state = dbo.trim(state),
country = dbo.trim(country),
schoolname = dbo.trim(开发者_如何学Cschoolname)

after trim all non-english text become ?????


Either the parameter to your Trim user-defined function is declared as varchar instead of nvarchar or you are using a variable declared as varchar in that function to build the results or you have declared the results to be varchar instead of nvarchar. We'd need to see the source of the Trim function to know for sure.


Something wrong with your dbo.trim user-defined function then I'm guessing. Do you have the source for it?


make sure that you trim functions accepts nvarchar and not just varchar otherwise it will do an implicit conversion, can you post the code

0

精彩评论

暂无评论...
验证码 换一张
取 消