Looking for a JavaEE Architect or Potential Tech Co-Founder?
Please don't hesitate to contact me.

How to alter bit and date column's default value in MSSQL

Aside from using the SQL Designer, you can alter a bit and date column's default value.
ALTER TABLE TableName ADD CONSTRAINT TableName_Disabled DEFAULT 0 FOR Disabled
ALTER TABLE TableName ADD CONSTRAINT TableName_DateCreated DEFAULT getdate() FOR DateCreated
To list the constraints created you can invoke:
EXEC sp_help TableName
How to alter bit and date column's default value in MSSQL How to alter bit and date column's default value in MSSQL Reviewed by Edward Legaspi on Tuesday, January 24, 2012 Rating: 5

No comments:

Powered by Blogger.