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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Insert nothing instead of NULL

Author  Topic 

Apples
Posting Yak Master

146 Posts

Posted - 2008-03-29 : 15:21:49
I have a small form where a user can give comments if they wish, but the comments are not required. If a person doesn't enter comments and I enter the form data into my database, it will insert NULL.

Is there a way that I can insert just blank text instead of NULL?

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-03-29 : 15:30:31
Yes , Use Coalesce and Isnull
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-03-30 : 00:02:51
I'd use a default value via a check constraint on the column that way you don't have to code for it.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -