question

Johny avatar image
Johny asked

Passing Unicode Parameter to Stored Procedure

I have a stored procedure:

CREATE PROCEDURE Product_Info                    
    @name nvarchar(40)                    
AS                    
SELECT *                    
FROM Product p                     
WHERE p.Name LIKE @name;                    

I know that if I want to pass a Unicode parameter, I can run this statement EXECUTE Product_Info @name = N'ChineseCharacter'

I am writing a CSharp .NET application to call the Stored Procedure. How can I pass the Chinese (Unicode) character as the parameter, without running the Execute statement ?

stored-proceduresprogrammingunicode
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
graz avatar image
graz answered

I don't believe you need to to anything special. .NET is Unicode by default. Any .NET code that calls the stored procedure should work just fine.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.