Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2007
    Posts
    4

    Question Unanswered: Get definition of check constraints

    Hi

    Is their any way to get the check constraint definition in sybase. I have already managed to get the constraint id, constraint name from the system tables. But after exploring the tables I haven't found any relationship between in the system tables to get the constraint definition. Well my actual req. is to edit the columns with the encrypted values which may not satisfy the check constraints. Since the sybase doesn't support the disabling of check constraints so I am now droping the constraints, update the table and then put the same constraints back. Now I need a approach to get the definition of constraints so that I can store them temporarily.

    Since I am quite new to database so if u found my approach wrong then please suggest me the correct apporoach.

    Thanks in advance.

    Regards
    New Bie

  2. #2
    Join Date
    Sep 2007
    Posts
    1
    sp_helpconstraint <table_name>

  3. #3
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    sp_helpconstraint [objname] [, detail]

  4. #4
    Join Date
    Sep 2007
    Posts
    4

    Use SYSCHECK system table

    Quote Originally Posted by pdreyer
    sp_helpconstraint [objname] [, detail]
    Hi

    Thanks both of you for the reply.

    I have tried to use the stored procedures, but i got an error Transact-SQL not supported with ODBC. Actually i am using ODBC connection with db.

    So I get the constraint information from SYSCHECK system table. Till now it seems to be worked fine. But I not sure whether my approach is correct or not as I am collecting all the meta data from system tables instead of using stored procedures and functions.

    Regards
    New Bie

  5. #5
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    Look at the code for sp_helpconstraint and compare it to what you have

Posting Permissions

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