I am having problem throwing error when i have to check for parameters that exists in stored proc.
BEGIN TRY
IF @parameters IS NULL
THROW EXCEPTION ---> how can i code here so that it checks for parameter and get caught in catch block if check fails.
SELeCT a,b c
from Table1
END TRY
BEGIN CATCH
PRINT 'Error Number:' = ERROR_NUMBER()
PRINT 'Error Line:' = ERROR_LINE()
PRINT ERROR_MESSAGE()
END CATCH