Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

deleting records that have a column empty

Status
Not open for further replies.

Tailgun

Technical User
Mar 30, 2002
417
US
I'm somewhat new to Microsoft SQL2K and know just about enough to get myself in trouble so I need some help.

If I run a query like Select* from tblClaim where FileNo is "" I want to then delete those records from the db.

Meaning any record with the FileNo column being empty I want to delete that complete record from the SQL db.

I also want to run it as a script allowing the user to delete those records by just selecting a menu item in VB to delete those records. Any and all help would be greatly appreciated.

Thanks
 
Simply replace SELECT * with DELETE.

Overall, this is a good practice - first write SELECT statement to check which records will be deleted, then replace SELECT [columns] with DELETE.

Also: some column values can be NULL - take care of that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top