I have a program that tries to alter various columns which means of course, I have to drop indexes and/or constraints on that column. I was looping through the indexes on the table and doing it that way but many of those indexes in that collection are constraints and I was getting an error stating that an explicit drop index is not allowed on that index because it is being used for a constraint. I discovered that anytime an index was marked as a constraint under the unique section in Enterprise Manager, it's actually a constraint. However, I do not see any way in SqlDmo to distinguish between the two. Here's the code I was using:
for each oIndex as sqldmo.index in otable.indexes
strQuery="DROP index " & otable.name & "." & oindex.name
next
So my question is, how do I know if an index is a constraint using the sqldmo object?
for each oIndex as sqldmo.index in otable.indexes
strQuery="DROP index " & otable.name & "." & oindex.name
next
So my question is, how do I know if an index is a constraint using the sqldmo object?