Getting Constraint name on Sql Server 2000

Posted by Peermohamedmydeen under Sql Server on 5/21/2013 | Points: 10 | Views : 1024 | Status : [Member] | Replies : 2
Hi All,

I know the table name and column name, and I want to get the default constraint name on the column for the table.

Note : I am able to get the default constraint name on Sql Server 2005 and above.


Regards,
PMM




Responses

Posted by: Saranya Boopathi on: 5/23/2013 [Member] Starter | Points: 25

Up
0
Down
Hi,
Try this

SELECT * FROM INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE


Saranya Boopathi

Peermohamedmydeen, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Peermohamedmydeen on: 5/27/2013 [Member] Bronze | Points: 25

Up
0
Down
Thanks Saranya.

Unfortunately INFORMATION_SCHEMA.CONSTRAINT_COLUMN_USAGE does not have default constraints.

BTW,

Select Object_name(constid) from Sysconstarints 


did the trick.


PMM



Peermohamedmydeen, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response