April 5, 2019 at 9:53 am
I want to add new column test to the table contact with type BIT with default value Y. PLease let me know how to do this
April 5, 2019 at 11:14 am
What have you tried so far? Have you had a look at the ALTER TABLE
syntax? There are loads of examples in the documentation, why didn't your attempt work?
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
April 5, 2019 at 1:25 pm
Bit data type is numeric in SQL: naturally 1 means Yes, 0 means No.
So:
CREATE TABLE dbo.table_name ( bit_column bit DEFAULT 1 );
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy