I'm just started using MSSQL and need to understand.
While I was reading few sample code that I might use in near future found
CREATE PROCEDURE [dbo].[SP_Set_LMS_BY_ERW] @UPA nvarchar(30) = NULL
Question is what's the difference between
Declare @count nvarchar(30)?
Best How To :
@UPA nvarchar(30) = NULL is the procedure argument/parameter (in this case, an optional parameter though since it's being declared like that having
NULL as the default value. So while calling procedure if you don't supply
@UPA, it will assume
NULL) that you need to supply while calling the procedure like
exec [dbo].[SP_Set_LMS_BY_ERW] @UPA=N'test123'
Declare @count nvarchar(30) is a local variable that's going to be use for some intermediary calculation or manipulation or to store some local data within your procedure body.