Home General

Option to always prefix table names with schema?

The default behavior when creating a database connection is to prefix table names with the schema only if a conflict occurs--that is, there are two same-named tables in different schemas.

Is there an option to always prefix table names with the schema? This would be beneficial for several reasons:

  1. The T-SQL convention in queries is to always prefix with the schema when a non-dbo schema exists. customer.Discounts, vendor.InterestRates, customer.Addresses
  2. Consistently prefixing tables reduces cognitive load. customer_Discounts, vendor_InterestRates, Addresses <== customer or vendor addresses?
  3. Schemas often provide domain and business context

If I haven't just missed an existing option, from the outside, this seems like a reasonable feature to implement since there's already a condition for prefixing. I'm hoping it would be as easy as "if hasConflict or alwaysPrefix then ..."

Comments

Sign In or Register to comment.