Hello, I have a question, I can't find documentation.
Basically, what is the use of those two points ":" (Tr:)
ALTER PROCEDURE [dbo].test
(
@test [int]
)
AS
BEGIN
SET NOCOUNT ON
set @test = '2';
Tr:
select @test as Test;
END
Hello, I have a question, I can't find documentation.
Basically, what is the use of those two points ":" (Tr:)
ALTER PROCEDURE [dbo].test
(
@test [int]
)
AS
BEGIN
SET NOCOUNT ON
set @test = '2';
Tr:
select @test as Test;
END
That defines a label. In this procedure the label is not used, but labels are used with the GOTO command. Here is a demo:
CREATE PROCEDURE gotodemo @i int AS
IF @i > 0
GOTO Here
ELSE
GOTO There
RETURN
Here:
PRINT 'We did come here'
RETURN
There:
PRINT 'Now we are over there'
go
EXEC gotodemo 23
EXEC gotodemo -87
go
DROP PROCEDURE gotodemo
12 people are following this question.