sql-generate-insert
sql-generate-insert copied to clipboard
Fix for issue of results table not returning data in insert order
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 :)