?
Solved

sql delete question

Posted on 2006-07-15
5
Medium Priority
?
169 Views
Last Modified: 2010-05-18
this connn.execute"delete from table where column = ' ' "
or connn.execute "delete from table where column = null"


both of these are not deleting?
I checked the table and that column is null?
0
Comment
Question by:thenone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 17116005
DELETE FROM Table WHERE Column IS NULL
0
 
LVL 8

Author Comment

by:thenone
ID: 17116029
and what if it is "" or contains a . that I want to delete same thing?
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 17116068
Add some ORs.

DELETE FROM Table WHERE Column IS NULL OR Column = '' OR Column = '.'

0
 
LVL 96

Accepted Solution

by:
Lee W, MVP earned 2000 total points
ID: 17116073
Frankly, I don't delete data from my tables.  I use tables that relate to each other on IDs and if I were to delete a row, I could end up messing up my database.  Instead, I create a field of bit type called "Del" - then I set Del = 0 for not deleted and Del = 1 for deleted.  Then in my criteria searches I just throw in to the WHERE clause ... AND Del = 0.  No accidental PERMANENT deletions this way.
0
 
LVL 8

Author Comment

by:thenone
ID: 17116295
oh ok so if the column is blank then = ' ' would work thanks its only when its null do you need to do is null.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month15 days, 14 hours left to enroll

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question