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 |
|
Sun Foster
Aged Yak Warrior
515 Posts |
Posted - 2006-07-10 : 12:16:06
|
| I setup a job to run at midnight everday as bellowtruncate table myTableOrderInsert into myTableOrder select * from myViewOrdermyTableOrder has a primary in OrderID.Problem is: if myViewOrder has duplicate OrderID, job will fail. How to void it so that job will run until end? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-07-10 : 12:20:44
|
| Make sure that the OrderID in myViewOrder is unique.you canInsert into myTableOrder select * from myViewOrderwhere OrderID not in (select OrderID from myViewOrder group by OrderID having count(*) > 1)but you should fix the source.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|