Primary key to be the last row in the table.

  • I was just assigned to review some conversion from as/400 dds to SQL tables, but I noticed that the tables they are creating they just adding a primary key fixed length of 15 numeric auto increment at the end of the table rather that to the beginning and with no create/change date columns. Some of these tables exceed 100 columns. ???

    Question, would this cause performance issues?

  • SQL is really good about not caring about the order of things, the order of columns, the order of data are not relevant to SQL, so having the PK as anything but the first column has no impact.

    it does make the table a bit harder to understand and visualize for the DBA, so if it's causing productivity problems, you could use the GUI to reorder the columns, but it has zero performance impact for SQL server itself.

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Thank you!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply