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.
| Author |
Topic |
|
gregoryagu
Yak Posting Veteran
80 Posts |
Posted - 2008-07-24 : 10:37:27
|
| Is there a function which returns whether or not there is a clustered index on a table?The reason I need this is that I am adding a clustered index via a script, and I want to make sure there is not one already before I add it. Greg |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2008-07-24 : 10:41:21
|
| have a look at sysindexesselect * from sysindexes where indid=1 and OBJECT_NAME(id)='YourTableName' |
 |
|
|
VGuyz
Posting Yak Master
121 Posts |
Posted - 2008-07-24 : 10:49:03
|
| by using the following sp,you can view the whole stucture of your tablesp_help table_nameorclick your table and press Alt+F1 |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2008-07-24 : 11:38:32
|
sp_helpindex table_name E 12°55'05.25"N 56°04'39.16" |
 |
|
|
gregoryagu
Yak Posting Veteran
80 Posts |
Posted - 2008-07-24 : 12:11:38
|
| Thanks very much.Greg |
 |
|
|
|
|
|