• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 460
  • Last Modified:

MS SQL 2008 What is the difference between a null field and an empty field?

I need to edit some MS SQL data and used an ACCESS project to do it. The data was in a view, and the editing went fine.

When i ran the application i got inconsistent results.

Looking at the data in MSSQL SMS i noted a difference between records i entered through ACCESS and other records: The ACCESS entered records contained NULL for empty fields. Other records had empty fields (necessary for the application) but did not show the NULL value.

The fields in question are varchars.

What causes the different presentation in SMS, and how can I make ACCESS create acceptable values?
0
KWDave
Asked:
KWDave
  • 3
  • 2
1 Solution
 
Anthony PerkinsCommented:
If by empty you mean it is '', then yes, they are fundementally different.  A value of NULL means it is unknown, which is not the same as ''.
0
 
KWDaveAuthor Commented:
Thanks for the try, but no joy yet.

I realize null and empty are different conditions. I don't know how to distinguish them in ACCESS, and the behave differently in MS SQL.

To test what i think was suggested, i entered '' in the fields in ACCESS. In MS SQL Server Management Studio the newly entered data showed as '', not empty as i need. when i deleted the '' in ACCESS, the fields again show as null in MS SQL SMS.

Unfortunately the SMS editor only allows editing the first 200 rows. The table has almost 1000 rows. There are only a handful that need editing. If ACCESS won't behavie, is there another editor that I could use to directly edit MS SQL tables?

The only other thing i can think of is to edit with a special character in ACCESS, and update the data in a query.

This is is ms sql 2008 R2, and Access in office 10.
0
 
Anthony PerkinsCommented:
>>Unfortunately the SMS editor only allows editing the first 200 rows. The table has almost 1000 rows<<
So why in the world are you doing this manually.  If you want them to be NULL then it is as simple as doing to following from a query window in SSMS:
UPDATE YourTableName
Set YourColumnName = NULL
WHERE YourColumnName = ''

Or:
UPDATE YourTableName
Set YourColumnName = ''
WHERE YourColumnName IS NULL

I still do not understand what is the problem.  If you do not understand the importance of NULL in DBMS then I suggest you do some reading on the subject.
0
 
KWDaveAuthor Commented:
This issue is too unique and trivial to add to the knowledge base
0
 
Anthony PerkinsCommented:
>>This issue is too unique and trivial to add to the knowledge base <<
I agree that this question is trivial and has no value in the PAQ, so you best request that the question be deleted.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now