Results 1 to 2 of 2

Thread: GOTO problem

  1. #1
    Join Date
    May 2003
    Location
    Epsom, United Kingdom
    Posts
    42

    Unanswered: GOTO problem

    I get the following error when I try and use a GOTO statment with my abel at the bottom of the script:

    [[A GOTO statement references the label 'ENDSCRIPT' but the label has not been declared.]]

    My code structure is as follows:

    Some code here

    SET NOCOUNT OFF

    SELECT * FROM PERSON_STAGE1 WHERE PERSONUID
    IN (SELECT PERSONUID FROM PRO_SING_QA_26923_AMMAR..PERSONUID)

    IF @@ROWCOUNT > 1
    BEGIN
    PRINT '*** ERROR: SCRIPT ENDING BECAUSE OF DUPLICATE UID'
    GOTO ENDSCRIPT
    END

    SET NOCOUNT ON

    .
    .
    .
    .
    .
    ENDSCRIPT:

    when I execute my code I get the error message mentioned above. Any suggestions?

    Thanks in advance.
    Shadow to Light

  2. #2
    Join Date
    Feb 2003
    Location
    Germany
    Posts
    53

    Re: GOTO problem

    hi,

    your script (as much as you have posted) works fine in my enviroment !

    markus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •