-
MSSQL auto numbering / identity
Hello!
I'm having trouble finding a solution to this auto numbering problem.
I know there can't be 2 IDENTITY datatypes in the same table like the sample tables below. But how do I solve this problem? Is there another way to do this?
Hope you understand my problem=)
The sample tables tries to display categories. A main-categori that whitch have under-categories.
CREATE TABLE dbo.MainCat
(
h_catID INT IDENTITY(1,1) NOT NULL,
h_cat_name CHAR(30),
CONSTRAINT PK_h_catID PRIMARY KEY CLUSTERED ( h_catID )
)
CREATE TABLE dbo.UnderCat
(
u_catID INT IDENTITY(1,1) NOT NULL,
u_cat_name CHAR(30),
h_catID INT IDENTITY(1,1) NOT NULL,
CONSTRAINT PK_u_catID PRIMARY KEY CLUSTERED ( u_catID )
)
nitefly
-
-
Thank you so much..=)
Nitefly
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|