Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Updating SQL Server table
Message
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01655887
Message ID:
01655903
Views:
45
>>If you need to know how many rows were updated, you can do
>>
>>cSQLCommand = "update ...;
>>
>>select @@RowCOUNT as RowsUpdated;"
>>
>>Then your cursor will have a single row with the number of rows updated.
>
>Do you mean to add the "@@RowCOUNT as RowsUpdated;" to my SQL update?
>
>That is, would my SQL update command look like this:
>
>
>cSqlUpdate = "update mytable set field1 = '1233' where id_field = 'ABC';select @@RowCOUNT as RowsUpdated"
>
>
>I used a semi-colon to separate two statement. Is this correct?
>
>UPDATE. I checked and it works. Thank you!

It was announced at some point that every command in T-SQL should end with semicolon. It works without also (to be backward compatible), but it's a good habit to start adding these semicolons when writing T-SQL code now.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform