November 1, 2007 at 8:51 am
How do you pass a datetime parameter to a stored procedure.
Enclosing the date in single quotes fails and my clever attempt to use a variable is no more successful:
use databasename
declare @wdate as datetime
set @wdate = convert(datetime, '20070914 00:00:00:000')
exec dbo.sp_Get_CDRL37_Data(@wdate, @wdate)
/* Line 5: Incorrect syntax near '@wdate'. */
Any ideas, anyone?
November 1, 2007 at 9:18 am
try taking out the parenthesis.
exec dbo.sp_Get_CDRL37_Data @wdate, @wdate
November 1, 2007 at 9:18 am
I think it might not like the () brackets.
EXECUTE master..xp_cmdshell ('dir *.exe')
EXECUTE master..xp_cmdshell 'dir *.exe'
November 1, 2007 at 9:55 am
Thanks, Rich and Allen... I guess I'm too much of a VB programmer, treating SPs as functions!
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply