yuvipoy (9/25/2012)
Thanks for your replay,As i have stated early [Quote]Inserting the data externally not from the database itself. [/Quote] my aim is not inserting from the database i need to insert data from non database which may be java or .net c# C++ or anything i need to check how for different connection how the times are taken.Now i'm working with C# so i have posted my example with C# where as i am coding on different platforms also.
The code which you have shared here is a internal one which done at the database level not at the C# level.
I'm not check the loop on database i am checking with C# code with data insertion as my preliminary requirement for now.
Thanks!
I get your point, you will insert data from the outside. However, I wanted to show you how different would the two approaches be. There're plenty of ways to do it and, as Matt said, a while loop will be the worst.
If you're trying to test how will a server respond under a high load (many users inserting data at the same time) it can be a good excercise. If you're trying how to improve the performance for a single user inserting lots of data, then you should look for alternatives.
Here's another way you might want to check http://www.sqlservercentral.com/articles/T-SQL/63003/