I came across this question few days back and ever since wanted to blog about it. Although it was asked to me in one of internal project training session, I though it might be worth asking in an interview process as well.
So the question was - Can we have 2 Identity columns in the same table ?
Let us try ans see if we can..
DECLARE @TEST TABLE
(
ID SMALLINT IDENTITY(1,1),
NEW_ID SMALLINT IDENTITY(1,1)
)
So the question was - Can we have 2 Identity columns in the same table ?
Let us try ans see if we can..
DECLARE @TEST TABLE
(
ID SMALLINT IDENTITY(1,1),
NEW_ID SMALLINT IDENTITY(1,1)
)
