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
 General SQL Server Forums
 New to SQL Server Programming
 Non-Cluster index not getting in table script.

Author  Topic 

hspatil31
Posting Yak Master

182 Posts

Posted - 2011-10-05 : 03:56:22
Dear All,

I have one table in that table I have sets Cluster and Non-Cluster index. Now when i am trying to take create table script then i am not getting create Non-Cluster index in same script. But i am getting cluster index.

Why ?

Thanks and Regard's
Harish Patil

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-05 : 04:07:38
you've to script out non clustered index separately for that
Clustered index will come as its part of primary key

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

hspatil31
Posting Yak Master

182 Posts

Posted - 2011-10-05 : 04:16:42
Hello Friend,

Why we are not getting create Non-cluster in table script ?
Means if i am having 1000 tables in DB and i want to take table script for 500 tables then i want to take create Non-cluster index for each table after the each table script.

Thanks,
Harish
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-05 : 04:22:14
if you want to script the indexes along with table use generate scripts option. This can accessed by selectingon database,right clicking and selecting tasks->generate scripts. you can select what all properties you want to script here like indexes,constraints,defaults,data etc and also what all tables, procs etc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

hspatil31
Posting Yak Master

182 Posts

Posted - 2011-10-05 : 04:39:30
Thnks. This information usefull for me.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-10-05 : 04:46:51
welcome

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -