Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 adding constraints with alter table

Author  Topic 

byecoliz
Starting Member

6 Posts

Posted - 2012-08-29 : 11:40:08
what are the advantages of adding constraints to tables with the ALTER TABLE STATEMENT when generating CREATE TABLE scripts? thanks

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2012-08-29 : 12:43:01
None that I can think of. I usually add the column level constraints as part of the column definition so that I can quickly see any limits or default values. I also define foreign keys and primary key as part of the table definition. It's probably a question of personal preference. I don't see any operational impact.

=================================================
We are far more concerned about the desecration of the flag than we are about the desecration of our land. -Wendell Berry
Go to Top of Page
   

- Advertisement -