UNIQUE constraints?!

Results 1 to 2 of 2

Thread: UNIQUE constraints?!

  1. #1
    Keith Railton Guest

    Default UNIQUE constraints?!

    Is there any way to find out if a particular field&#039s value must be unique (i.e. there is a unique constraint set on this field on the database)? Any help would be much appreciated...<BR><BR>Thanks,<BR><BR>Keith.

  2. #2
    Steve Nicholls Guest

    Default RE: UNIQUE constraints?!

    If the provider supports it you might be able to determine this by using a combination of the following openschema methods.<BR><BR>Using the querytype adSchemaTableConstraints with the criteria CONSTRAINT_TYPE set to "UNIQUE" will return unique constraints for a table.<BR><BR>Using the querytype adSchemaConstraintColumnUsage will return the constraint names for a column (but unfortunately not their types).<BR><BR>Whether this is practical is another matter altogether it may be more appropriate to make sure you error handled detects failed inserts/updates when duplicate values are set.<BR><BR>regards, Steve <BR><BR><BR><BR><BR><BR>

Posting Permissions

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