We are using Sybase ASE 12.5.3 I am trying to create a large table, minimize logging and add an identity column. It takes several queries to create the table. For the first step I use
SELECT columns, rowid=identity(9) INTO new_table FROM source_table1
This works fine with the values starting at 1. Then I try to add additional rows:
SELECT columns, rowid=identity(9) INTO EXISTING TABLE new_table FROM
source_table2 WHERE ...
The values of the IDENTITY column restart at 1, so now I have 2 rowids=1.
When I try to remove the rowid from the SQL I get an error stating the number of columns don't match the table number.
Can anyone help with this?
select qid=1,id=identity(9),name into #t1 from master..sysdatabases
select qid=2,id=identity(9),srvname into existing table #t1 from master..sysservers
select qid=3,id=identity(9),name into existing table #t1 from master..sysusers
select * from #t1 order by qid,id
drop table #t1