Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 N' polish parameter

Author  Topic 

andriex
Starting Member

4 Posts

Posted - 2010-02-22 : 07:18:12
Hi,

i have a problem. i have a database Latin_General_CI_AS's collation, but on 1 field i need to have polish collation.

if i use tish sql:
UPDATE Table1
SET Field1 = N'dzialalnosci'

it's alla right, it update my field with 'l' char, but if i use a parameter, how can i do to use N?

Sachin.Nand

2937 Posts

Posted - 2010-02-22 : 08:09:48
I am not quite to sure but maybe this

UPDATE Table1
SET Field1 = @parameter Collate Polish_CI_AS

PBUH
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-22 : 08:10:40
make parameter as unicode

ie like DECLARE @Param nvarchar(100)

then use it like

UPDATE Table1
SET Field1 = @param


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

andriex
Starting Member

4 Posts

Posted - 2010-02-22 : 08:45:51
quote:
Originally posted by visakh16

make parameter as unicode

ie like DECLARE @Param nvarchar(100)

then use it like

UPDATE Table1
SET Field1 = @param


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





Hi,

i use this but this,

DECLARE @Param nvarchar(100)
SET @Param='xxxx'
UPDATE Table1
SET Field1 = @param

but it convert polish char to 'normal' char..
Go to Top of Page

andriex
Starting Member

4 Posts

Posted - 2010-02-22 : 08:47:49
quote:
Originally posted by Idera

I am not quite to sure but maybe this

UPDATE Table1
SET Field1 = @parameter Collate Polish_CI_AS

PBUH



i try it, but it convert polish char to 'normal' char..
in this post if i write special char (polish char) it convert it to 'normal' char...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-22 : 08:49:37
try

DECLARE @Param nvarchar(100)
SET @Param=N'dzialalnosci'
UPDATE Table1
SET Field1 = @param


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

andriex
Starting Member

4 Posts

Posted - 2010-02-22 : 09:04:44
quote:
Originally posted by visakh16

try

DECLARE @Param nvarchar(100)
SET @Param=N'dzialalnosci'
UPDATE Table1
SET Field1 = @param


------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





OK, but this @param is a parameter of my Stored Procedure.. then i cannot use this...
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-22 : 09:55:32
why?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -