Tuesday 15 February 2011

SQL primary key default value with char -


I need to separate my primary key with the employee and the user, so I want the 'primary' number for the employee. Is this also possible? It is a bad idea to do this, not just because it adds meaning to the primary key that is there (What happens if you decide to rent one of your users?), But also because you have to change an integer area to slow down four characters.

To complete what you want (I think), you can be called PersonType to another area and then you can select from 'Employee * where PersonType =' E '" Or, like you can individually put an index on the individual framework to inquire about it.

Is there any different data that you want to store for employees vs. users? For example Are you your employees Want to store your home address, not your users, or your users' credit card numbers, but your employees? In this case, you can not add another column to another table Want to keep the information.


No comments:

Post a Comment