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 |
|
Steve95
Starting Member
19 Posts |
Posted - 2007-05-11 : 06:13:15
|
| Hi AllI have need to know of an effective way to delete 2000 records from a table holding 4000 records. Their is a unique key ie. originalno. which identifies each record and also I have the originalno. of all the records that need to be deleted from a excel sheet provided by the business. The records to be deleted are in a non sequential format.But what syntax/way do I use to make this quick and correct rather than going through each originalno, and placing comers after each to extract the relevant records for deletion?Many Thanks in advance....... |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-11 : 07:24:34
|
This forum is not for posting questions. Please post in appropriate forum.Mods, here is a work for you !! Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-05-11 : 07:38:44
|
Import the numbers from Excel into a temporary "staging" table, and then delete joining to that table:DELETE DFROM MyTable AS D JOIN MyStagingTable AS S ON S.originalno = D.originalno Kristen |
 |
|
|
spirit1
Cybernetic Yak Master
11752 Posts |
Posted - 2007-05-11 : 08:26:46
|
| moved from Script library to here._______________________________________________Causing trouble since 1980blog: http://weblogs.sqlteam.com/mladenp |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
|
|
|