question

Anthony Osborn avatar image
Anthony Osborn asked

Can I have optional parameters to my stored procedures?

Can I have optional parameters to my stored procedures?

stored-proceduresparameters
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
dave ballantyne avatar image
dave ballantyne answered

You haven't provided much detail , but this is how you can default parameter values (and therefore make them optional)

Create Procedure proc @Param1 integer = NULL
as
return
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.