Unless otherwise specified when you create your tables primary key in SQL Server 2000, 2005 and 2008 will have a clustered index on it. This will be a good default choice if you are going to be joining other tables together on this value. If you are going to be joining or selecting based on another value in the table, then you should probably use a nonclustered primary key. Here is how you do it in T-SQL at the time of table creation:
create table DemonstrationTable
(
TableIdColumn int identity not null primary key nonclustered,
TableValueColumn nvarchar(255)
)
go
Posted
Jan 24 2009, 02:54 PM
by
dacrowlah