Tuesday, September 8, 2009

sql server



Checking Naming Conventions of MSsql Constraints and Indexes
If you create constraints and indexes in Management Studio, they are automatically named based on their type and the name of the table they belong to. If you create them manually, or overwrite their default names, naming may end up inconsistent. Here are two simple queries to check for naming conventions. Check that the constraint names match 'constraint type' + 'table name': SELECT p.name, CASE c.type WHEN 'F' THEN 'FK' WHEN 'D' THEN 'DF' WHEN 'UQ' THEN 'UK'

Blog Marketing

No comments:

Post a Comment