Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Performance of different INSERT styles

$
0
0

Hi all,

What is difference between these two styles of TSQL code:

WHILE 1...to...1000

BEGIN

INSERT ... VALUES(...)

END

----------------------

BEGIN TRAN

WHILE 1...to...1000

BEGIN

INSERT ... VALUES(...)

END

COMMIT TRAN

-----------

The second with BEGIN TRAN is executed very very faster than the first one.

What's the reason?

Many thanks in advance

Leila


Viewing all articles
Browse latest Browse all 15889

Trending Articles



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