• By default a primary key will have a clustered index created, assuming there is not already a clustered index on the table. In your first query you create the table and VIN will have a clustered index, then you add the clustered index on CarID and VIN is now a nonclustered index. For your example table I would quite possibly drop CarID and use VIN as the primary key.

    The whole point of foreign keys is for RI. Yes there is a minor performance hit but it is generally not noticeable, and the integrity of the data is worth the hit.

    You might want to take a long look at the stairways articles on indexes. I think when you finish reading those you will have a much deeper understanding. You can find the Stairways over on the left side (4th or 5th from the top).

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/