Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Updating SQL Server table
Message
 
 
À
28/11/2017 11:41:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01655887
Message ID:
01655903
Vues:
47
>>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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform