views:

15

answers:

1

how do one call a stored procedure that has date input .

spName getDate()

does not work.

the question is about calling within ms sql managment studio.

+4  A: 

SQL Server 2008

declare @d date = getdate() /*Or datetime looking at the title*/
exec spName @d

Earlier Versions

declare @d datetime
set @d = getdate()
exec spName @d
Martin Smith
thanks, that works.
none
I've known for more than a decade that SQL Server procedures can't take functions as parameters, but I still try to do this every now and again. Because it _should_ work, damn it :)
Matt Gibson