sql - how can I get a variable with all the results and iterate over it? -


i have table records, 40, called table1.

i create new register in table each these records, don't know how can it. iterate while loop each record , insert record in other table, don't how (the syntax).

i this:

foreach record in mytable1      insert table2(idtable1) values(record.idtable1) end foreach 

i don't know scripts in sql server.

thanks.

if have insertion, can this:

insert table2 (idtable1) select idtable1 mytable1 

it select idtable1 mytable1 , insert them table2.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -