i want to insert values from table1 to table2 with incremantal value

Posted by adnan on Stack Overflow See other posts from Stack Overflow or by adnan
Published on 2010-04-29T16:29:47Z Indexed on 2010/04/29 16:47 UTC
Read the original article Hit count: 186

Filed under:
|

i tried something like this but the id value is not changing, getting the value for first record and set the value for all rest...

insert into table1 (Id,b,c,d) 
 (select (select max(Id)+1 from table1),x,y,z from table2 where... )

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005