I asked a similar question last week and didn’t get a very good response, so perhaps I didn’t phrase the question in the right way.
I’d like to know what processes/policies/rules your team has in place for writing T-SQL code and database schema. Here are a couple examples:
1) All foreign key columns should be indexed
2) All primary key columns should be integer Identity
3) All stored procedures/user defined functions need comments
4) No underscores in T-SQL variable names
These are the sorts of things I’m curious about.
Thanks!
Not really. We don’t have indexes on some larger table FKs because we never delete or update the parent value, or poor selectivity
Mostly, but understand why. That said, I’d use the 3 digit code itself for a table that stored ISO currency codes such as CHF or GBP. And you’ll still need a unique constraint on the natural key