I need to define and generate primary key for 2 or more tables.
Tables hold same type of data but FOR Some BUSINESS RULES we have to make them separate say like
TableA = LOCAL_CUSTOMERS
TableB = INTERNATIONAL_CUSTOMERS
Both hold same columns like, CUSTOMER_ID C_NAME, CITY ....etc
While designing the Primary Key I want these keys to be a combination of PREFIX and an auto generated number, as an auto increamented int PK will do.
for example, CUSTOMER_ID (PK) for the table "LOCAL_CUSTOMERS"
LOC1, LOC2, LOC3,...... LOC5000
and CUSTOMER_ID (PK) for the table "INTERNATIONAL_CUSTOMERS"
INT1, INT2, INT3,...... INT5000
WHERE LOC and INT are prefix for LOCAL , INTERNATIONAL.
we can set auto increment in "identity specification" by using int but how can i do this ? Is it "Computed Column Specification" I need to set for the column ?
Thanks