Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Performance comparison of using WHILE and CURSOR
Message
From
26/06/2009 11:23:42
 
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Application:
Web
Miscellaneous
Thread ID:
01408571
Message ID:
01408678
Views:
47
Hi,

Thanks for reminding, just noticed that by adding the PRIMARY KEY will speed up the WHILE loop a lot.

Basically I have few tables to store system data of application, and those data maybe added/updated from time to time. Thus, I have a master script to store the latest data and will be executed on the client's server upon application update.

What I'm currently doing is,

1. Create a table variable with identical structure of the actual table.
2. Create INSERT for each data.
3. Compare the existing data and table variable with WHILE/CURSOR looping.
4. Find the difference and do necessary action.

Perhaps my approach is wrong? Kindly advise, thanks.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform