Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parameters with or without 'AS' keyword in TSQL

I'm somewhat new to TSQL (mostly MySQL experience). I came across some parameter declarations and I'm unsure what, if any, the difference is when declared in a stored proc with versus without the 'as' keyword:

CREATE PROCEDURE [dbo].[SomeStoredProc]
    @variable1 varchar(50),
    @variable2 as varchar(50)
...
like image 942
Randy Hall Avatar asked Oct 18 '22 22:10

Randy Hall


1 Answers

Strangely enough the documentation does not show AS as being part of the syntax neither optional nor mandatory.

But, anyway, there is no difference.

like image 54
Radu Gheorghiu Avatar answered Oct 21 '22 09:10

Radu Gheorghiu