I am attempting to use the goto statement with a variable.
I.E.
CREATE PROCEDURE dbo.test
@label VARCHAR(20)
AS
GOTO @label
Step2:
PRINT 'This is Step2'
GO
If @label was Step2 I want it to print This is Step2. Does anyone know how to do this? If you run this code it will report invalid syntax near @label. Any help would be appreciated. Thanks.