ALTER TABLE question
-
SQL Server 2008R2. Do all defaults need a constraint name? Why would you or would you not use a constraint name? Example of a SSMS created table script:
ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [DF_MyTable_MyDateColumn] DEFAULT (getdate()) FOR [MyDateColumn]
GOALTER TABLE [dbo].[MyTable] ADD DEFAULT ((0)) FOR [MyBitColumn]
GOThanks
-
SQL Server 2008R2. Do all defaults need a constraint name? Why would you or would you not use a constraint name? Example of a SSMS created table script:
ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [DF_MyTable_MyDateColumn] DEFAULT (getdate()) FOR [MyDateColumn]
GOALTER TABLE [dbo].[MyTable] ADD DEFAULT ((0)) FOR [MyBitColumn]
GOThanks
From what I read on table constraints[^] It's to maintain backwards compatibility.
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
-
From what I read on table constraints[^] It's to maintain backwards compatibility.
Every day, thousands of innocent plants are killed by vegetarians. Help end the violence EAT BACON
Thank you! As I have a tendensy to skim the definitions I miss things.
-
SQL Server 2008R2. Do all defaults need a constraint name? Why would you or would you not use a constraint name? Example of a SSMS created table script:
ALTER TABLE [dbo].[MyTable] ADD CONSTRAINT [DF_MyTable_MyDateColumn] DEFAULT (getdate()) FOR [MyDateColumn]
GOALTER TABLE [dbo].[MyTable] ADD DEFAULT ((0)) FOR [MyBitColumn]
GOThanks