Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7439319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:41:21+00:00 2026-05-29T10:41:21+00:00

In my SQL Server databases I group my tables by schema to help organize

  • 0

In my SQL Server databases I group my tables by schema to help organize their purpose.

When I create constraints for columns on these tables I’ve been including the Schema as part of the name. For example, if I have a tables such as Com.WebUser and Com.Company:

PK_Com_WebUser                     --Primary key constraint
FK_Com_WebUser_Com_Company         --Foreign key to Com.Company table
UQ_Com_WebUser_CompanyID_Username  --Unique constraint on CompanyID & Username

I figured in the case I ever had another table with the same name in a different schema putting the schema in the constraint name would make things clearer, but the names are a bit verbose.

Is there a best practice for naming these objects?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:41:22+00:00Added an answer on May 29, 2026 at 10:41 am

    I think adding the schema name is a good practice for the reason you already mentioned (repeated table names across schemas), I wouldn’t worry about how verbose the constraint name is, because you rarely need to reference those constraints.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a few SQL Server databases (all in one server), containing their own
I have a SQL Server 2008 database with 2 tables. These tables are Address
I've been trying to figure out why SQL Server has db_owner schema and db_owner
I want create a role in SQL server 2008, which will allows specific group
We have a couple of mirrored SQL Server databases. My first problem - the
Anyone using MozyPro to backup SQL Server databases? I'm concerned about the way it
I have two SQL Server 2005 databases, one is for development and the other
We have several SQL Server 2000 databases (I know, we need to upgrade) that
I have two SQL Server (2000) databases. Both are used for the same project,
I have two SQL Server 2008 databases called Anna and Bob . Bob has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.