• I'm happy to have a look at the code you create and give it a sanity check.

    In response to your question, you need to drop it by the constraint name, If you goto ssms and locate the constraint on the table that you want to drop, right click and script as drop you'll see how it should be dropped.

    I would also consider using a naming standard for the constraints, I personally use the following prefixes

    DF : Default

    CK : Check

    FK : ForeignKey

    PK : PrimaryKey

    UQ : Unique

    Such that the name of the Check constraint on the Servicetable for serviceCode would read

    CK_ServiceTable_ServiceCode

    The FK name would be

    FK_ServiceRenderedTable_ServiceTable_ServiceCode

    That way I can tell what a constraint is doing and which column/object is affected without having to script the constraint.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices