We have a case where we need to disable and enable identity for multiple tables in a single session for Sybase. I have been trying to find a solution, but am unable to find a satisfactory one so far. Solutions such as creating new table/column without identity, copying data, then dropping old table/column is costly, since the source table may contain huge volume of data. Also SET IDENTITY_INSERT ON/OFF can be performed for only a single table in a session and hence this won’t work as well.
Any suggestions? Sybase version used is: Adaptive Server Enterprise/15.7/EBF 21148 SMP SP100 /P/RS6000/AIX 6.1/ase157sp100/3426/64-bit/FBO/
P.S: We had similar case for SQL Server. It was done through ALTER TABLE ... SWITCH command as suggested here -> Adding an identity to an existing column. Anything similar for Sybase should work also.