5 use newlines to split logical parts of statements, for better reading/understanding
source | link

SSMS scripts foreign keysForeign Key constraints as two statements:

ALTER TABLE {table}  
WITH CHECK  
ADD CONSTRAINT {constraintname} {constraint spec}
GO

ALTER TABLE {table}  
CHECK CONSTRAINT {constraintname}
GO

What is the purpose of the second statement?

SSMS scripts foreign keys as two statements:

ALTER TABLE {table} WITH CHECK ADD CONSTRAINT {constraintname} {constraint spec}
GO

ALTER TABLE {table} CHECK CONSTRAINT {constraintname}
GO

What is the purpose of the second statement?

SSMS scripts Foreign Key constraints as two statements:

ALTER TABLE {table} 
WITH CHECK 
ADD CONSTRAINT {constraintname} {constraint spec}
GO

ALTER TABLE {table} 
CHECK CONSTRAINT {constraintname}
GO

What is the purpose of the second statement?

    Tweeted twitter.com/StackDBAs/status/898427837891223552
4 edited tags
| link
3 edited tags
| link
2 edited title
| link
1
source | link