Hi MichaelHorwell-4553,
Thank you for reaching out to the SQL Forum.- SET IDENTITY_INSERT TableName ON is session‑scoped. That means:
- It only applies to the current connection.
- SQL Server allows only one table per session to have IDENTITY_INSERT set to ON.
- As soon as the session ends (for example, you close the query window or disconnect), the setting is automatically reset to OFF.
- If you reconnect and want to insert explicit values into the identity column again, you’ll need to re‑run the SET IDENTITY_INSERT command.
Hope This Helps!!
Thanks,
Lakshmi.