简体   繁体   中英

Add N' Character Before Insert statement SQL Server 2005

I have a problem that needing help, please give me an advice. I want to insert database from one Oracle Server to SQL server by statements as:

SELECT * INTO ABC_temp SELECT * FROM DIM_PROVINCE

In DIM_PROVINCE and ABC_temp have 3 columns: PROVINCE_ID , PROVINCE_NAME and NOTE The problem is It can not shows VietNamese Language. After I searched on the internet for helping, everybody shows that I must use N' character before INSERT statement. So, how can I replace this statement.

INSERT INTO ABC_temp values (N’abc,N’abc,N’abc)

By statement bellows:

SELECT * INTO ABC_temp SELECT * FROM DIM_PROVINCE

Thank You!

I don't think you need to.

The 'N' is used to denote that the string is a unicode literal, so if the datatype in Oracle is unicode as well, there may not be a need to convert (SQL Server does an implicit conversion from VARCHAR to NVARCHAR ).

Otherwise, you can cast the values (see CAST and CONVERT (Transact-SQL)

You put the N outside the single quotes.

INSERT INTO ABC_temp values (N'abc', N'abc', N'abc')

The SQL statement should follow the syntax:

insert into ABC_temp
select * from DIM_PROVINCE

(In SQL Server, this is how you do it. I'm not sure about the syntax in Oracle.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM