Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to update multiple rows without stored proc
Message
General information
Forum:
Microsoft SQL Server
Category:
Other
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01306751
Message ID:
01306797
Views:
3
>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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform