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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Default bit data type?

Author  Topic 

hueby
Posting Yak Master

127 Posts

Posted - 2004-12-09 : 15:38:37
Hi everyone, I have a bit data type that I want defaulted to 0 (False). If I simply put 0 in the Default Value (within Enterprise manager) it doesnt work. It comes up <NULL> still.

What can I do? Thanks

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-09 : 16:16:00
Use query analyser?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

hueby
Posting Yak Master

127 Posts

Posted - 2004-12-09 : 16:20:19
As in to see if it comes up as <NULL> ??? Or using QA for something else? Sorry, I'm not following you....
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-12-09 : 16:20:34
Changing the default value doesn't change your data that already exists. When you go to INSERT data into the table and you don't specify a value for that column, then SQL Server will put 0 for you at that time. If you do specify a value, then SQL Server will use the supplied value instead of the default value.

Tara
Go to Top of Page

hueby
Posting Yak Master

127 Posts

Posted - 2004-12-09 : 16:24:39
hmmm... okay It must be the way I'm inputting data in my VB app then, because I do have default values set, and I'm not entering any values for those certain columns. Thanks for the info!
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2004-12-09 : 17:00:23
Why don't you post the DDL of the table.

Also do you use Query Analyzer? (QA)



Brett

8-)
Go to Top of Page

hueby
Posting Yak Master

127 Posts

Posted - 2004-12-09 : 17:02:46
Well I did find the problem... I was using a DataGrid, and it was defaulting my value to NULL and I guess over-writing the SQL default. I fixed it now though!

I use QA to test my Stored Procedures... thats about all I know how to use it for. I'm sure it is much more useful though!!! ??? :)
Go to Top of Page
   

- Advertisement -