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 |
meef
Posting Yak Master
113 Posts |
Posted - 2012-05-01 : 14:49:34
|
I need to delete 84 records and it's going to be a huge pain typing:WHEREname = 'this' OR name 'that' OR....Is there any other way to delete or am I going to have to sit here and type it all out? |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-01 : 14:52:17
|
you've to either do that or put the required values onto a temporary table and do likeDELETE tFROM YourTable tINNER JOIN TempTable tmpON tmp.field = t.nameWHERE .... any other conditions where do you got these values from? is it already present in a master table field?------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
meef
Posting Yak Master
113 Posts |
Posted - 2012-05-01 : 14:55:12
|
Yeah, there are about 150 total records in a user account table and I need to delete 84 of them. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-05-01 : 15:45:48
|
quote: Originally posted by meef Yeah, there are about 150 total records in a user account table and I need to delete 84 of them.
get those 84 ids onto a table and use suggested queryother wise form a comma delimited list using 84 values and use dynamic sql------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
|
|
|
|
|