设计器overkill


Warning: Undefined array key "HTTP_REFERER" in /www/wwwroot/prod/www.enjoyasp.net/wp-content/plugins/google-highlight/google-hilite.php on line 58

在增加主键或设置默认值时,若用设计器,则会重建表,避免方法就是用t-sql

ALTER TABLE dbo.TestInt ADD CONSTRAINT
    DF_TestInt_Col1 DEFAULT 1 FOR Col1


ALTER TABLE dbo.TestInt ADD CONSTRAINT
    PK_TestInt PRIMARY KEY CLUSTERED
    (Col1)  ON [PRIMARY]

参考:Do not trust the SSMS designers