Using function as a parameter when executing a stored procedure? [duplicate]

You can’t use a function directly as a stored procedure parameter.

You can do the following:

DECLARE @now DateTime
SET @now = GETDATE()

DECLARE @return_value int
EXEC @return_value = my_stored_procedure
        @MyId = 1,
        @MyDateField = @now
SELECT  'Return Value' = @return_value
GO

Leave a Comment

techhipbettruvabetnorabahisbahis forumu