Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

insert rows in million in batch

$
0
0

hi

i want do something liek this

declare @max int

select @max = count(*) from table1 a join table2 b on a.id = b.id and a.date>getdate()

while(@max)

insert into table c

column1,

column2

select * from 

 table1 a join table2 b on a.id = b.id and a.date>getdate()

i dotn know exacxt logic, buy i have so m any rows and i need to do it on batch and faster


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>