when tried execute a stored procedure which uses getdate() function as a variable it produced error message like this
MSG 102, Level 15, State 1, Line 10
Incorrect syntax near ')'.
the query is given below
Quote:
GO
DECLARE @return_value int
EXEC @return_value = [dbo].[INSERT_CALLBACK_67]
@PHONE ='46346',
@CALLBACKTIMEORG = getdate(),
SELECT 'Return Value' = @return_value
GO
|
then i rewrite the query and executed by declaring getdate() function as given below, it gave correct result
Quote:
USE [testy5]
GO
DECLARE @return_value int
DECLARE @dt DATETIME;
SET @dt = GETDATE();
EXEC @return_value = [dbo].[INSERT_CALLBACK_67]
@PHONE = '6757866',
@CALLBACKTIMEORG = @dt,
SELECT 'Return Value' = @return_value
GO
|
why this is happening ,i would like know the concept behind
thanks in advance