In the following T-SQL script:
CREATE TABLE #testdata
(id int IDENTITY(1,1) PRIMARY KEY,
field VARCHAR(MAX))
INSERT INTO #testdata
VALUES
('this should be row 1'),
('this should be row 2'),
('this should be row 3')
is there any guarantee that id will match the intended row number? This seems to be the case in all my tests so far, but I can't find any documentation saying that this is always the case.
I'd like to rely on this behavior, but I need to be sure that there isn't any factor that might result in a different insert order.
I am using SQL Server 2012.