December 21, 2011 at 6:40 pm
Hi all,
What's wrong with my simple code below?
use mydb
go
CREATE PROCEDURE SA.MYCUR1
@PDATE DATETIME2
AS
DECLARE @VORDER_ID [numeric](12, 0) ;
Command(s) completed successfully.
EXEC SA.MYCUR1 @PDATE=sysdatetime()
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near ')'.
December 21, 2011 at 7:18 pm
You can't pass the date function in directly, pass it through a variable:
from MSDN: http://msdn.microsoft.com/en-us/library/ms189915.aspx
-- Passing the function value as a variable.
DECLARE @CheckDate datetime;
SET @CheckDate = GETDATE();
EXEC dbo.uspGetWhereUsedProductID 819, @CheckDate;
GO
December 21, 2011 at 8:59 pm
frankly, that doesn't make sense to me...
but thank you for clarification anyway.
December 21, 2011 at 10:53 pm
ahmed_b72 (12/21/2011)
frankly, that doesn't make sense to me...but thank you for clarification anyway.
Me too...
I don't have access to SQL Server right now. Can you please try following?
EXEC SA.MYCUR1 sysdatetime() -- NOT tested
December 22, 2011 at 2:18 am
Hope the below link will give better clarification
Let me know if you need more explanation
December 22, 2011 at 3:38 am
Thanks 🙂
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply