Solved

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

Posted on 2011-03-15
4
316 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
  • 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
 

Author Comment

by:afacts
ID: 35140701
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
MS SQL Bulk load data error 5 34
Noob question:this site is sql vulns? 2 46
Sort by Month and Year - SQL 3 23
Slow SQL query 12 27
Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now