September 12, 2014 at 8:21 am
Hi I wanna add IsEllgible flag to this table
what data type should I use and sytax
this is for nvarchar
ALTER TABLE [dbo].[GetPageData]
ADD COLUMN PreviewContent [nvarchar](4000) null
GO
Please send me the code for Flag thing
September 12, 2014 at 8:30 am
Hey,
i guess the field "IsEllgible" is supposed to conaint values for true and false. Therefore i would recommend a bit field.
Syntax should be
ADD COLUMN IsElligible bit null
September 12, 2014 at 9:13 am
moz987 (9/12/2014)
Hey,i guess the field "IsEllgible" is supposed to conaint values for true and false. Therefore i would recommend a bit field.
Syntax should be
ADD COLUMN IsElligible bit null
The above also will allowed NULL, which could be treated as UNKNOWN or else.
If you want to restrict to True/False only, define your column as non-null eg:
ADD COLUMN IsElligible bit not null
September 12, 2014 at 9:29 am
I would suggest the NOT NULL constraint as Eugene mentioned, but I would also add a DEFAULT to it.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply