Results 1 to 5 of 5
  1. #1
    Join Date
    Jun 2011
    Posts
    63

    Unanswered: View all db constraints?

    From sql management studio, is it possible to view all current constraints on the database? Or using another way?

    Thanks

  2. #2
    Join Date
    Jul 2011
    Location
    India
    Posts
    13
    hi,

    try it



    SELECT OBJECT_NAME(OBJECT_ID) AS NameofConstraint,
    SCHEMA_NAME(schema_id) AS SchemaName,
    OBJECT_NAME(parent_object_id) AS TableName,
    type_desc AS ConstraintType
    FROM sys.objects
    WHERE type_desc LIKE '%CONSTRAINT'

    all the best

  3. #3
    Join Date
    Jun 2011
    Posts
    63
    How can i do it from the user interface?

  4. #4
    Join Date
    Mar 2007
    Location
    Holmestrand, Norway
    Posts
    332
    Directly from the user interface, you cannot. And I'm tempted to say of course. Constraints are bound to an object, and not to the database itself. So, under a table or a view you may look at all the constraints for that specific object. Please note that foreign key constraints and primary key constraints are located under "keys", while other constraints are located under "constraints".
    Ole Kristian Velstadbråten Bangås - Virinco - MSSQL.no - Facebook - Twitter

  5. #5
    Join Date
    Jun 2011
    Posts
    31
    Provided Answers: 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •