Information générale
Forum:
Microsoft SQL Server
Versions des environnements
SQL Server:
SQL Server 2005
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
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement