Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Deleting anonymous customers
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Yak Posting Veteran

65 Posts

Posted - 01/07/2013 :  14:51:31  Show Profile  Reply with Quote

We have a SQL table in our CMS called customer.dbo

This table creates a permanant account for those customers who purchase from us but also creates a temporary one when a customer is on the site. We have a monthly maintenance that usually deletes this anon records but it no longer seems to be working.

There are fields that are given a NULL Value that are required when a customer purchases. Is there any SQL script that will delete these anon records from our SQL table (the fields for example are email, FirstName, LastName) so if these records are NULL what SQL script can I run to remove them?

Flowing Fount of Yak Knowledge

2875 Posts

Posted - 01/07/2013 :  15:09:01  Show Profile  Reply with Quote
If the req is that all the fields are null

WHERE COALESCE(email, FirstName, LastName) IS NULL
This won't delete records that have an empty string


Everyday I learn something that somebody else already knew
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000