Reputation
7,290
Top tag
Next privilege 10,000 Rep.
Access moderator tools
Badges
1 9 24
Newest
 Caucus
Impact
~178k people reached

May
1
comment T-SQL insert value based on identity column
@Jyrkka - I'm not offended, so don't worry on that account. My point is that using an identifier prefix to encode something that is an independent fact about the entity is considered bad design as it violates the spirit of database normalization rules insofar as it creates a situation in which non-key attributes are not dependent on the whole key. Perhaps pseudo-random is a less apt term than meaningless. An IDENTITY value (or Sequence value) is not related semantically to other (non-key) attributes of the entity. In that sense it may as well be a random number, rather than sequential.
Apr
28
comment T-SQL insert value based on identity column
It doesn't make much sense to me to embed a customer type code in a pseudo-randomly generated customer identifier. The conventional wisdom is not to build meaning into identifiers. As rules of thumb go that is a good one in my experience. However, your mileage may vary.
Apr
27
revised T-SQL insert value based on identity column
Add constraints for clarity
Apr
27
comment T-SQL insert value based on identity column
@PaulWhite - obviously, but if the IDENTITY is being used in a PK, one would assume that such a precaution will be taken. The OP's question didn't include DDL, so one is left to presume.
Apr
27
answered T-SQL insert value based on identity column
Apr
9
comment DISTINCT Role in SELECT
I'm guessing that you have 3,074 agents and they each match your various criteria at least once.
Mar
30
comment How to insert values in junction table for many to many relationships?
@siddhesh - @@IDENTITY is SQL Server. I have corrected this answer to reflect MySQL, which is one of the OP's tags. The MySQL equivalent of @@IDENTITY is LAST_INSERT_ID().
Mar
30
revised How to insert values in junction table for many to many relationships?
Corrected answer for MySQL syntax (vs. SQL Server)
Mar
23
answered db schema for a object with multiple foreign key tables
Mar
19
revised Database design - Projects with multiple Clients but only specific client contacts
Added an illustration for clarity
Mar
18
answered Best away to keep monthly records of loans
Mar
18
answered Should I have a parent table with only one field?
Mar
18
answered Database design - Projects with multiple Clients but only specific client contacts
Mar
18
comment database design question - How to make the table 3NF and have no orphans
+1 for mapping close to reality.
Mar
15
revised Which databases can meet these replication requirements?
Modified tags to get the right eyes on this question
Mar
15
answered How can I compare the schema of two databases?
Mar
15
answered Warehouse Database Design Question
Mar
14
revised How to insert values in junction table for many to many relationships?
Fixed typo
Feb
17
comment School fees database design
All financial databases should begin with a double-entry accounting design. Students are customers and will have accounts. Fees are like products that students buy. Find a good reference design for accounting and product sales and apply it to your system.
Feb
1
revised Getting sum result for last year divided quarterly
Corrected spelling, grammar and punctuation to make the question easier to understand.