dbTalk Databases Forums  

Default values

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Default values in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ghost Dog
 
Posts: n/a

Default Default values - 07-20-2005 , 11:49 AM






How do you tell the script to set the default value for a boolean field to
false?

[RPIFlag] bit NOT NULL DEFAULT false, (doesn't work)




Reply With Quote
  #2  
Old   
Narayana Vyas Kondreddi
 
Posts: n/a

Default Re: Default values - 07-20-2005 , 01:11 PM






There are no 'true' and 'false' values for boolean datatype in SQL Server.
Instead we have 1 and 0, where 1 means true and 0 means false. So, your
statement should look something like below:

[RPIFlag] bit NOT NULL DEFAULT (0)
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/



"Ghost Dog" <caspar (AT) friendly (DOT) com> wrote

Quote:
How do you tell the script to set the default value for a boolean field to
false?

[RPIFlag] bit NOT NULL DEFAULT false, (doesn't work)






Reply With Quote
  #3  
Old   
Ghost Dog
 
Posts: n/a

Default Re: Default values - 07-21-2005 , 04:16 PM



Thanks, that works

"Narayana Vyas Kondreddi" <answer_me (AT) hotmail (DOT) com> wrote

Quote:
There are no 'true' and 'false' values for boolean datatype in SQL Server.
Instead we have 1 and 0, where 1 means true and 0 means false. So, your
statement should look something like below:

[RPIFlag] bit NOT NULL DEFAULT (0)
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/



"Ghost Dog" <caspar (AT) friendly (DOT) com> wrote in message
news:eRhFqqUjFHA.2444 (AT) tk2msftngp13 (DOT) phx.gbl...
How do you tell the script to set the default value for a boolean field
to
false?

[RPIFlag] bit NOT NULL DEFAULT false, (doesn't work)








Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.