I have a table with a column that needs to be updated with a data type. However, triggering any change to the script causes errors due to an unnamed unique restriction.
I need to abandon this restriction, but, unfortunately, I do not know this name. I have a script that currently lists all the unique constraints in a table, but I need to figure out how to go this step further and associate the constraint names with columns.
Select *
From sysobjects
Where sysobjects.xtype = 'UQ' AND sysobjects.parent_obj= OBJECT_ID(N'Users')
it returns
UQ__Users__45F365D3
UQ__Users__46E78AOC
I need to know which column theses are tied to in order to remove the correct one. I need to support SQL 2000, 2005 and 2008.
Any suggestions would be appreciated.
Thanks Ben