Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to update multiple rows without stored proc
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Versions des environnements
SQL Server:
SQL Server 2005
Divers
Thread ID:
01306751
Message ID:
01306797
Vues:
5
>Hi everybody,
>
>I know, I should create a test case and try it before asking the questions, but I was wondering how the following works.
>
>Say you get a cursor from a table, using SPT. Then you update some records of the cursor. Then you want to update the table with the changes. Can it be done without a stored procedure? That is, if I send to SQL Server (using SPT) an update string as following:
>
>
>update mytable from mytable join c_mytable on c_mytable.pk = mytable.pk set myfield1 = c_mytable.myfield1
>where (cSomeExpr)
>
>
>My instinct tells me that since SQL Server does not know anything about the cursor c_mytable, the above will fail. Correct?

This is more VFP question than SQL Server one.
When using SPT you have two choices:
1. SCAN through SPT Cursor and send UPDATE for each updated record.
2. Make SPT Cursor updatable. Check How to make SQL Pass-Through cursor updatable FAQ #8153 and use TABLUPDATE() at the end :-)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform