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 |
kond.mohan
Posting Yak Master
213 Posts |
Posted - 2014-06-14 : 03:48:47
|
Hi ,i has created ssis pkg for dataloading from oracle to sql server.one of my table Executed(inserted same transction day Records) twice into sql server table.we need to Delete oneset of Records from Sql server table for that specific day. i have used below manner to insert into tableinsert into tablenameSelect * from tablenaem where tran_date = trunk(sysdate -1 )exampleabove query Executed twice in a day. |
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2014-06-14 : 17:56:52
|
Is there a column, such as an identity column, that will help determine which is in the second set?Tara KizerSQL Server MVP since 2007http://weblogs.sqlteam.com/tarad/ |
|
|
BBarn
Starting Member
14 Posts |
Posted - 2014-06-16 : 08:07:07
|
Select DISTINCT into a temporary table (By Date? or any field(s) combination that gets you the doubled up transactions). DELETE from the original table and INSERT INTO back to the main table from your TEMP table. |
|
|
|
|
|