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 |
MrSingh
Starting Member
5 Posts |
Posted - 2011-03-14 : 10:27:04
|
Hi, I am fairly new to databases and need a hand moving data from a staging to a live table. Schema is identical between the databases but content is different. I am trying to run the following using SQL Server 2005 DTS however it is falling over at line 2 incorrect syntax error. Could you please take a look and advise of a resolutions? All comments are welcome, thank you.DatabasesLive = Test_LiveStaging Test_StagingTableToolCloumn ToolCodeINSERT INTO Test_Live.ToolFROM Test_Staging.ToolWHERE Test_Staging.Tool.ToolCode NOT IN Test_Live.Tool.ToolCode |
|
pk_bohra
Master Smack Fu Yak Hacker
1182 Posts |
Posted - 2011-03-14 : 15:03:52
|
--Your method.INSERT INTO Test_Live.ToolSelect ToolCodeFROM Test_Staging.ToolWHERE Test_Staging.Tool.ToolCode NOT IN (select ToolCode from Test_Live.Tool) --Another methodINSERT INTO Test_Live.ToolSelect ToolCode FROM Test_Staging.Tool TOutWHERE Not Exists (Select 1 from Test_Live.Tool Tin where Tout.ToolCode = Tin.ToolCode ) Note:I have not carried out any testing. |
 |
|
|
|
|