Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
@@Error
Message
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
@@Error
Divers
Thread ID:
01113074
Message ID:
01113074
Vues:
53
I have the following code in the Query Analyzer that should generate the error:
INSERT INTO test(field1, field2, field3) values ('PP','PP',0,'hh')

IF @@error <> 0
   Print 'Failed'
ELSE
   Print 'OK'	
GO
Why does the @@error global variable is not being set to the error number?? The print statement is never executed.

Server: Msg 110, Level 15, State 2, Line 6
There are fewer columns in the INSERT statement than values specified in the VALUES clause. The number of values in the VALUES clause must match the number of columns specified in the INSERT statement.

TIA,
Daniel
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform