| | |
how to delete data from table
Please support our MS SQL advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Jun 2007
Posts: 19
Reputation:
Solved Threads: 0
hello,
i have a table having 4000 (four thousand) records and now i want to delete 3000 of them as i don't need them, these records have primary key as id which is ofcourse unique.
can anyone tell me how can i delete these records with one query.
if their is any other method please let me know.
Thanks in advance.
i have a table having 4000 (four thousand) records and now i want to delete 3000 of them as i don't need them, these records have primary key as id which is ofcourse unique.
can anyone tell me how can i delete these records with one query.
if their is any other method please let me know.
Thanks in advance.
So is there any special criteria which distiguishes these 3000 records from the other records. If there is, you can use that clause to delete the required rows. If this is just a mass delete and if your primary key is ordered, you can delete the rows based on the value of primary keys.
sql Syntax (Toggle Plain Text)
DELETE FROM mytable WHERE key <= 3000;
I don't accept change; I don't deserve to live.
•
•
Join Date: Sep 2009
Posts: 2
Reputation:
Solved Threads: 0
Truncate tables code worked a treat thanks
Worldwide Windows VPS Hosting Solutions
Ultima Hosts LLC - Since 2005
Ultima Hosts LLC - Since 2005
![]() |
Similar Threads
- how to delete duplicate record in a table by using SQL query (MS SQL)
- How to save data from a variable to a table. (PHP)
- Convert XML data to sql table through coding in ASP.Net2.0 (IT Professionals' Lounge)
- How to delete a data structure in Builder 6.0? (C++)
- How can i deledet and update from table ??????? (PHP)
Other Threads in the MS SQL Forum
- Previous Thread: Anyway to use Having in this SQL STMT?
- Next Thread: How to connect two tables
| Thread Tools | Search this Thread |






