Results 1 to 3 of 3

Thread: constraint ddl

  1. #1
    Join Date
    Nov 2002
    Posts
    207

    Unanswered: constraint ddl

    When I see desing table option in enterprise manager of a table I don't see any constraints, but when I extract ddl I can see all 6 of them. They are all unique constraints not the check constraints. Is this normal. I am new to SQL Server and would appreciate some explanation.

    Thanks

  2. #2
    Join Date
    Oct 2003
    Posts
    84
    Could these be unique indexes you are talking about? They are different from field level constraints.

  3. #3
    Join Date
    Nov 2002
    Posts
    207
    This is the part of the DDL generated...

    ALTER TABLE [EMCSdbuser].[doc2] WITH NOCHECK ADD
    CONSTRAINT [DF__doc2__archive_st__623A9EC6] DEFAULT ('UAR') FOR [archive_status_cd],
    CONSTRAINT [DF__doc2__viewed_cd__632EC2FF] DEFAULT ('UNV') FOR [viewed_cd],
    CONSTRAINT [DF__doc2__review_typ__6422E738] DEFAULT ('NEW') FOR [review_type_cd],
    CONSTRAINT [DF__doc2__pending_st__7FAD6821] DEFAULT (0) FOR [pending_state_cd],
    CONSTRAINT [DF_doc2_lastaccessdate] DEFAULT (getdate()) FOR [lastaccessdate],
    CONSTRAINT [DF__doc2__Message_Si__07C4568C] DEFAULT (0) FOR [Message_Size],
    CONSTRAINT [AK_DOC2_EXTERNAL_IDENTIFICATION] UNIQUE NONCLUSTERED
    (
    [external_identification]
    ) ON [FG_INDEX] ,
    CONSTRAINT [AK_doc2_process_date] UNIQUE NONCLUSTERED
    (
    [processdate],
    [status_cd],
    [direction_cd],
    [doc2_id]
    ) WITH FILLFACTOR = 80 ON [FG_INDEX] ,
    CONSTRAINT [AK_doc2_processdate] UNIQUE NONCLUSTERED
    (
    [processdate],
    [doc2_id]
    ) WITH FILLFACTOR = 80 ON [FG_INDEX] ,
    CONSTRAINT [ak_doc2_sender_address_id] UNIQUE NONCLUSTERED
    (
    [sender_address_id],
    [doc2_id]
    ) WITH FILLFACTOR = 80 ON [FG_INDEX] ,
    CONSTRAINT [AK_doc2_status_cd] UNIQUE NONCLUSTERED
    (
    [status_cd],
    [processdate],
    [review_type_cd],
    [doc2_id]
    ) WITH FILLFACTOR = 80 ON [FG_INDEX] ,
    CONSTRAINT [AK_doc2_subject] UNIQUE NONCLUSTERED
    (
    [subject],
    [doc2_id]
    ) WITH FILLFACTOR = 80 ON [FG_INDEX]
    GO

Posting Permissions

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