|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I need to convert this SELECT statement to a DELETE statement
SELECT CustId FROM Profile WHERE CustId LIKE 'HEAT%' AND CustId NOT IN (SELECT CustId FROM CallLog) Here is what I've come up with: DELETE FROM Profile WHERE CustId LIKE 'HEAT%' AND CustId NOT IN (SELECT CustId FROM CallLog) Could someone please check if the DELETE statement looks correct, since I have no way of testing it. This statement is going to run on a database that contains about 1 million records. It's going to delete about six thousand records. My question: is a simple DELETE statement such as this one going to do the job, or do I have to formulate a more complex DELETE statement? Could someone please help me? It would be very much appreciated. Thank you. |
|
#2
|
||||
|
||||
|
i parsed it with query analyzer:
"The command(s) completed successfully." although i would advise you to backup the db before running it ask your db admin for when the next backup will be and to answer your question: you would be suprised at how effective simple sql statements are ![]() |
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > Convert a SELECT into a DELETE statement |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|