I have the same problem as described in this question, but there it’s SQL Server 2005 and the ‘accepted’ answer doesn’t work in SQL Server 2000.
Specifically: I’m trying to run ALTER TABLE foo DROP COLUMN bar, and it’s failing because there’s a ‘default constraint.’ Meaning, I have a default value on that column which SQL Server implements as a separate constraint that I need to delete first.
The problem is no name was given for the default constraint when the column was created, so I have to query the system tables to discover the (auto-generated) name of the constraint.
The answer given in that other question works for me in SQL Server 2005 but not in SQL Server 2000. I need the latter.
[UPDATE] I need a query that can answer the question ‘What is the name of the default constraint for column bar in table foo.’ Not a way for a human being to manually find the answer.
Just figured out what the referenced SQL 2005 query was actually doing. Here’s a replication of that query that works in SQL 2000