views:

25

answers:

2

Hello, can I somehow call a stored proc without params, even though it normally has params?

Thanks :-)

+3  A: 

You can if you set the params in the stored proc to have a default value. Then you don't have to pass them.

EDIT:

CREATE PROCEDURE [ProcName]
(
    @filterId int = NULL
)

Doing this will eliminate the need to have to pass it. Though you can if you want to.

spinon
+3  A: 

If you can, recreate the SPROC with default parameters

CREATE PROC myproc(@param1 AS INT = 0, @param2 AS VARCHAR(20) = '')

etc

nonnb