Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
First SP
Message
 
 
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Divers
Thread ID:
00759576
Message ID:
00759585
Vues:
17
Sergey,

That's helpful. Could you please explain one simple principle on this example:
IF @tcUserID IS NULL
      BEGIN
        PRINT 'ERROR: The UserID value must contain a value.'
        RETURN 1
      END
What happens here? Is it an early exit point? Do I need to enclose IF with ELSE always?

I want to understand the principle, I looked into few SPs and I'm trying to read Help, but it's not that helpful so far... May be I'm looking in the wrong place...


>First, there's garbage at the end of your sproc. Second, double click on the error message and QA will bring you to the line with error.
>
>>Hi everybody,
>>
>>I'm trying to write an SP. Here is what I've wrote so far:
>>
>
>>-- =============================================
>>-- example to execute the store procedure
>>-- =============================================
>>DECLARE <@variable_for_output_parameter, sysname, @p2_output> <datatype_for_output_parameter, , int>
>>EXECUTE <procedure_name, sysname, proc_test> <value_for_param1, , 1>, <@variable_for_output_parameter, sysname, @p2_output> OUTPUT
>>SELECT <@variable_for_output_parameter, sysname, @p2_output>
>>GO
>>
>>I when tried to execute it and here is what I got:
>>=======================================================
>>Server: Msg 170, Level 15, State 1, Procedure sp_InsertShoppingCartInfo, Line 58
>>Line 58: Incorrect syntax near 'UserID'.
>>Server: Msg 170, Level 15, State 1, Procedure sp_InsertShoppingCartInfo, Line 70
>>Line 70: Incorrect syntax near 'CartID'.
>>
>>What is incorrect here?
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