Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2011-03-15
4
Medium Priority
?
357 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

688 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