Quantcast
Channel: Luke Hayler » Tag » TSQL
Viewing all articles
Browse latest Browse all 4

Set Parameter Defaults for Stored Procedures

$
0
0

Did you know that you can set defaults for your Stored Procedure parameters? No? Well, it turns out that you can. And it’s pretty straight forward too.

To set a default to a stored procedure parameter all you have to do is add “= <value>” when you declare your parameters in your CREATE PROCEDURE statement.

CREATE PROCEDURE usp_MyStoredProcedure (@Parameter1 DATE = GetDate(), @Parameter2 VARCHAR(10) = ‘MyValue’)

That’s it!


Viewing all articles
Browse latest Browse all 4

Trending Articles