create table Linq_TB
{
url_id int NOTNULL,
Pg_Name nvarchar(50) NOTNULL,
URL nvarchar(50) NUTNULL,
CONSTRAINT Linq_id PRIMARY KEY (url_id,DBCC Checkident(Linq_TB,RESEED,0) case url_id not in(select URL_Id from URL_TB ))
}
I want to make a table which it's primary key is Linq_id
and gets it's value from both the url_id
and identity with start from 1 and increments 1 by 1. url_id
is a foreign key. For example if url_id
is 1, linq_id
's will be 11, 12, 13,... and I also want to reset linq_id
identity when the url_id
changes.
What should the query be? The query above doesn't work, why?
Thanks in advance