sql-generate-insert icon indicating copy to clipboard operation
sql-generate-insert copied to clipboard

Fix for issue of results table not returning data in insert order

Open barneynicholls opened this issue 4 years ago • 0 comments

Hi, I noticed that the insert and identity on/off statements when pulling from a view often got mixed up and would appear randomly within the output.

I identified the issue being the @Results table not having a primary key therefore the results wouldn't necessarily be returned in a specific order.

By adding an IDENTITY column then setting that as the Primary Key the issue was resolved.

Thanks for sql it's been a great help :)

barneynicholls avatar Sep 17 '21 10:09 barneynicholls