Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Performance comparison of using WHILE and CURSOR
Message
De
26/06/2009 11:23:42
 
 
À
26/06/2009 07:54:30
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Application:
Web
Divers
Thread ID:
01408571
Message ID:
01408678
Vues:
49
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform