Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Order in Create Table statement

Author  Topic 

JacobPressures
Posting Yak Master

112 Posts

Posted - 2005-07-18 : 14:33:04
Does the syntax of the Create Table statement specify an order for all the parameters or just the Datatype. For example,

Create Table dbo.Employees
(
EmpID smallint NOT NULL PRIMARY KEY IDENTITY,
FirstName varchar(30) NOT NULL,
LastName varchar(30) NOT NULL
)

My books consistently put the statment in this order

Create Table dbo.Employees
(
EmpID smallint IDENTITY NOT NULL PRIMARY KEY,
FirstName varchar(30) NOT NULL,
LastName varchar(30) NOT NULL
)

I like to keep my code lined up so i would like to place the less frenquent stuff on one end or the other so that it is easier to read.

jhermiz

3564 Posts

Posted - 2005-07-18 : 14:46:22
I usually keep key information (foreign vs primary) at the top, but it doesnt matter.


Keeping the web experience alive -- [url]http://www.web-impulse.com[/url]
Imperfection living for perfection --
[url]http://jhermiz.blogspot.com/[/url]
Go to Top of Page

JacobPressures
Posting Yak Master

112 Posts

Posted - 2005-07-18 : 14:48:27
thanks!
Go to Top of Page
   

- Advertisement -