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.
Author |
Topic |
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2010-07-08 : 10:53:38
|
I am going to use a link server to transfer datafrom an Oracle db to MSSql DB. The issue is the field names are different. Can you give me a small sql example that would take it from one to the other?DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
|
Kristen
Test
22859 Posts |
Posted - 2010-07-08 : 13:23:21
|
[code]INSERT INTO MS_SQL_Table( MsCol1, MsCol2, MsCol3, ...)SELECT OraCol1, OraCol2, OraCol3, ...FROM LinkedOracleServer.OracleDatabase[/code]or replace "LinkedOracleServer.OracleDatabase" with [code]FROM OPENQUERY(LinkedOracleServer, N'SELECT OraCol1, OraCol2, OraCol3, ...FROM OracleDatabase')[/code] |
 |
|
helixpoint
Constraint Violating Yak Guru
291 Posts |
Posted - 2010-07-08 : 14:20:35
|
Ok. Thankyou. So how do you deal with MsCol1 if it is a primary key. This is my sql PKey is a primary KeyINSERT INTO Bond (PKey, ModifyDate)SELECT TOP (200) BONDAG_ID, CREATION_DATEFROM RBDMS..FIX_DBA.BOND_AGREEMENTS AS BOND_AGREEMENTS_1WHERE (BONDAGSTCD_ID = 4)DaveHelixpoint Web Developmenthttp://www.helixpoint.com |
 |
|
|
|
|