|
-
Mar 21st, 2002, 09:53 PM
#1
Scripts for getting Constraint Information
Hello there,
I need a sql query to get the constraint information from a sql server database / table.
Given a constraint name, I wish to know the following details.
the columns on which the constraint is based.
the table on which the constraint is based
the referenced table and columns on which the constraints are based in case of a foreign key constraint. Could you please help me?
I want this to workin case of Primary Key Constraint, Foreign Key Constraint and UNique Key COnstraint.
I am using sql server 7.0
Kind Regards,
Abhijit
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
-
Mar 23rd, 2002, 11:11 AM
#2
got the solution
Hi there,
i have got the solution to this one. Please don't reply me on this.
There is a stored proc called sp_helpconstraint 'table_name' which returns me a recordset.
Cheers!
Abhijit
Everything that has a computer in will fail. Everything in your life, from a watch to a car to, you know, a radio, to an iPhone, it will fail if it has a computer in it. They should kill the people who made those things.- 'Woz'
save a blobFileStreamDataTable To Text Filemy blog
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|