Monday, March 12, 2012

Quick simple question!

Hello all,
Using SQL Server 2000, if I create a primary key on a table, does that
automatically create an index - or should one be created manually?
Thanks all,
Jon
This will create the index automatically.
Adi
Jon wrote:
> Hello all,
> Using SQL Server 2000, if I create a primary key on a table, does that
> automatically create an index - or should one be created manually?
> Thanks all,
> Jon
|||Thanks,
Would this be the same for Foreign Keys also?
Thanks,
Jon
"Adi" wrote:

> This will create the index automatically.
> Adi
> Jon wrote:
>
|||No - I have a script here to add indexes to all FKs:
http://www.replicationanswers.com/Script23.asp
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Paul, that's great, thanks very much - I notice that it was created in 2005,
will it work for 2000?
Once an index has been created on a table, do you need to re-analyse the
tables or does SQL Server do this automatically? We're using 2000.
Thanks,
Jon
"Paul Ibison" wrote:

> No - I have a script here to add indexes to all FKs:
> http://www.replicationanswers.com/Script23.asp
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
|||Jon - sorry - didn't notice that you were on SQL Server 2000. I used to have
a corresponding script for 2000 but can't find it now and guess I never
posted it to my site . I'll do some digging in my backups and see what I
can find.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

No comments:

Post a Comment