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
 SQL Server Development (2000)
 Index List

Author  Topic 

Lazer
Starting Member

8 Posts

Posted - 2002-01-10 : 13:42:05
Dose anyone know how to get a list of the Indexes from a database using SQLDMO in Visual Basic?

I'm using the following code but I just can't find a Column object under the Index Object.

Dim MyTable As SQLDMO.Table
Dim MyIndex As SQLDMO.Index
Dim strFields As String

txtLog.Text = ""
For Each MyTable In GlobalSQLDatabase.Tables
For Each MyIndex In MyTable.Indexes

'Try to get the Fields in the strFields variable

txtLog.Text = txtLog.Text & MyIndex.Name & " - (" & strFields & ")" & vbCrLf

DoEvents
Next MyIndex
Next MyTable




Edited by - Lazer on 01/10/2002 13:44:49
   

- Advertisement -