Solved

When creating a table in SQL Server does the order of the columns matter?

Posted on 2011-03-15
4
345 Views
Last Modified: 2012-05-11
I remember hearing a long time ago that column ordering in table creation matters.  That basically the columns with the 'lighter' datatypes int, bit, etc should go near the top and the 'heavier' ones varchar(2000), ntext, etc should go near the bottom.

Is this true?  I've been googling for more information but haven't found much.  I'm working on a schema for a new system that we'll be developing and I want to make it robust and scalable ... not to mention very well optimized.

Any helpful instruction would be greatly appreciated ...
0
Comment
Question by:afacts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
4 Comments
 

Author Comment

by:afacts
ID: 35140672
hmmmm I may have answered my own question.  Right after posting I found this article here:

http://stackoverflow.com/questions/34818/sql-server-does-column-order-matter
0
 

Accepted Solution

by:
afacts earned 0 total points
ID: 35140765
One more:

http://www.sqlskills.com/BLOGS/KIMBERLY/post/Column-order-doesnt-matter-generally-but-IT-DEPENDS!.aspx

so basically in general it doesn't matter but best practice is move the variable length nullable fields to the end of the table if you have a lot of them and the DB is expected to be large ...
0
 

Author Closing Comment

by:afacts
ID: 35140769
Got the answer I needed ...
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question