SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SSIS package can't convert between unicode and non
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

KindnessPays
Starting Member

USA
1 Posts

Posted - 01/28/2013 :  18:46:53  Show Profile  Reply with Quote
Receiving a message 'can not convert between unicode and non unicode string data types. I'm using this command to create the field. Destination is a nvarchar.
'IPSD' + RIGHT ('000000' + CAST(Staff_ID AS nvarchar(6)), 6)

James K
Flowing Fount of Yak Knowledge

3712 Posts

Posted - 01/28/2013 :  18:50:51  Show Profile  Reply with Quote
Try one of these:
'IPSD' + RIGHT ('000000' + CAST(Staff_ID AS varchar(6)), 6)
N'IPSD' + RIGHT (N'000000' + CAST(Staff_ID AS nvarchar(6)), 6)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52323 Posts

Posted - 01/29/2013 :  02:37:26  Show Profile  Reply with Quote
try using a derived column task or data conversion and do the casting inside it

if derived column use

(DT_WSTR,6) your column name

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

Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000