0

我有一个需要帮助的问题,请给我一个建议。我想通过以下语句将数据库从一台 Oracle 服务器插入到 SQL 服务器:

SELECT * INTO ABC_temp SELECT * FROM DIM_PROVINCE

在 DIM_PROVINCE 和 ABC_temp 有 3 列:,PROVINCE_ID问题 是它不能显示越南语。在网上搜索帮助后,大家都表明我必须在INSERT语句之前使用N'字符。那么,我该如何替换此语句。PROVINCE_NAMENOTE

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

通过以下声明:

SELECT * INTO ABC_temp SELECT * FROM DIM_PROVINCE

谢谢你!

4

2 回答 2

1

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)

于 2012-10-02T02:24:04.350 回答
0

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.)

于 2012-10-02T02:25:54.843 回答