Home > Archive > MS SQL Server DTS > July 2005 > Default values









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Default values
Ghost Dog

2005-07-20, 11:23 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)



Narayana Vyas Kondreddi

2005-07-20, 1:23 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@friendly.com> wrote in message
news:eRhFqqUjFHA.2444@tk2msftngp13.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)
>
>
>



Ghost Dog

2005-07-21, 8:24 pm

Thanks, that works

"Narayana Vyas Kondreddi" <answer_me@hotmail.com> wrote in message
news:O1L%238ZVjFHA.576@tk2msftngp13.phx.gbl...
> 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@friendly.com> wrote in message
> news:eRhFqqUjFHA.2444@tk2msftngp13.phx.gbl...
to[color=darkred]
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com