March 21, 2012 at 4:27 pm
How i can convert varchar(20) to Nvarchar(20) and Nvarchar(16) to nvarchar(20).
March 21, 2012 at 4:33 pm
where do you want to convert?
March 21, 2012 at 4:53 pm
I have one destination column with Nvarchar(20) and i want to load data from two columns and their data types are varchar(20) and nvarchar(16).so that's why i want to change the data type of two sources into nvarchar(20).
March 21, 2012 at 5:02 pm
Explicitly, before loading the data into the the destination column, u can use CAST/CONVERT to convert them.
But, AFAIK, SQL Server will implicitly convert the source columns to NVARCHAR(20) before inserting..
March 22, 2012 at 9:17 am
I want to convert column_A varchar(20) to column_c Nvarchar(20) and Column_B Nvarchar(16) to column_c nvarchar(20).
is this right?
for source column_A having datatype varchar(20)
cast(ColumnA as Nvarchar(20))
for source column_B having datatype Nvarchar(16)
CAST(COLUMN_B AS NVARCHAR(20))
March 22, 2012 at 1:08 pm
weston_086 (3/22/2012)
I want to convert column_A varchar(20) to column_c Nvarchar(20) and Column_B Nvarchar(16) to column_c nvarchar(20).is this right?
for source column_A having datatype varchar(20)
cast(ColumnA as Nvarchar(20))
for source column_B having datatype Nvarchar(16)
CAST(COLUMN_B AS NVARCHAR(20))
yes, you are absolutely correct.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply