Results 1 to 2 of 2

Thread: Scripts for getting Constraint Information

  1. #1

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Post 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

  2. #2

    Thread Starter
    PowerPoster abhijit's Avatar
    Join Date
    Jun 1999
    Location
    Chit Chat Forum.
    Posts
    3,228

    Cool 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
  •  



Click Here to Expand Forum to Full Width