Hi gurus
I have two tables
I want to make sure these two tables should never have same id's
Why i need this is i want to find whether a given id is actually a classid or just userid.
If it is a classid then i should retrieve all userid's in that classid(this is stored in seperate table userclassmembers)
i think one way of doing this is
when we create newid(by using select max(userid))check this against other table whether this id exists or not.if not exists then create id happily.
Any ideas on how i could go about this would be greatly appreciated.
I have two tables
Code:
users(userid int,name varchar(50))
userclass(classid int,name varchar(50))
I want to make sure these two tables should never have same id's
Why i need this is i want to find whether a given id is actually a classid or just userid.
If it is a classid then i should retrieve all userid's in that classid(this is stored in seperate table userclassmembers)
i think one way of doing this is
when we create newid(by using select max(userid))check this against other table whether this id exists or not.if not exists then create id happily.
Any ideas on how i could go about this would be greatly appreciated.