<p>In terms of performance and optimizations:</p>

<ul>
<li>When constructing a table in SQL Server, does it matter what order I put the columns in?</li>
<li>Does it matter if my primary key is the first column?</li>
<li>When constructing a multi-field index, does it matter if the columns are adjacent?</li>
<li>Using ALTER TABLE syntax, is it possible to specify in what position I want to add a column?

<ul>
<li>If not, how can I move a column to a difference position?</li>
</ul></li>
</ul>

[{'answer_id': 34823, 'author': 'Ricardo Reyes', 'author_id': 3399, 'author_profile': 'https://Stackoverflow.com/users/3399', 'pm_score': 2, 'selected': False, 'text': '<p>I would say the answer to all those questions is NO, altough my experience with  MS-SQL goes as far as SQL2000. Might be a different story in SQL2005</p>\n'}, {'answer_id': 34827, 'author': 'SQLMenace', 'author_id': 740, 'author_profile': 'https://Stackoverflow.com/users/740', 'pm_score': 1, 'selected': False, 'text': '<p>No to the first 3 because the index will hold the data and no the last once also</p>\n'}, {'answer_id': 34831, 'author': 'Daniel Jennings', 'author_id': 3641, 'author_profile': 'https://Stackoverflow.com/users/3641', 'pm_score': 2, 'selected': False, 'text': '<p>For the fourth bullet: No you can\'t specify where you want to add the column. Here is the syntax for ALTER TABLE: <a href="https://msdn.microsoft.com/en-us/library/ms190273.aspx" rel="nofollow noreferrer">https://msdn.microsoft.com/en-us/library/ms190273.aspx</a></p>\n\n<p>In MySQL they offer an ALTER TABLE ADD ... AFTER ... but this doesn\'t appear in T-SQL.</p>\n\n<p>If you want to reorder the columns you\'ll have to rebuild the table.</p>\n\n<p>Edit: For your last <em>last</em> bullet point, you\'ll have to DROP the table and recreate it to reorder the columns. Some graphical tools that manipulate SQL databases will do this for you and make it look like you\'re reordering columns, so you might want to look into that.</p>\n'}, {'answer_id': 34859, 'author': 'Aidan Ryan', 'author_id': 1042, 'author_profile': 'https://Stackoverflow.com/users/1042', 'pm_score': 3, 'selected': False, 'text': '<p>In SQL Server 2005, placement of nullable variable length columns has a space impact - placing nullable variable size columns at the end of the definition can result in less space consumption.</p>\n<p>SQL Server 2008 adds the &quot;SPARSE&quot; column feature which negates this difference.</p>\n<p>See <a href="https://web.archive.org/web/20210119185209/http://zine.net.pl/blogs/sqlgeek/archive/2008/06/06/en-column-order-does-it-matter.aspx" rel="nofollow noreferrer">here</a>.</p>\n'}, {'answer_id': 2732820, 'author': 'egrunin', 'author_id': 147463, 'author_profile': 'https://Stackoverflow.com/users/147463', 'pm_score': -1, 'selected': False, 'text': '<p>For the first bullet:</p>\n\n<p><strong>Yes</strong>, column order <em>does</em> matter, at least if you are using the deprecated BLOBs <code>image</code>, <code>text</code>, or <code>ntext</code>, and using SQL Server &lt;= 2005.</p>\n\n<p>In those cases, you should have those columns at the \'end\' of the table, and there is a performance hit every time you retrieve one.</p>\n\n<p>If you\'re retrieving the data from such a table using a DAL, this is the perfect place for the <a href="http://en.wikipedia.org/wiki/Lazy_loading" rel="nofollow noreferrer">Lazy Load</a> pattern.</p>\n'}, {'answer_id': 45012616, 'author': 'Nithin', 'author_id': 7883986, 'author_profile': 'https://Stackoverflow.com/users/7883986', 'pm_score': 0, 'selected': False, 'text': '<p>Column order does not matter while creating a table. We can arrange the columns while retrieving the data from the database. Primary key can be set to any column or combination of columns.</p>\n'}]
['https://Stackoverflow.com/questions/34818', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/357/']