I can't seem to get the GETDATE() syntax to work in a Job Step of type Transact-Sql Script. I put in the command as:
execute insertMostRecentUpdate
@Data='Data',
@Date=GETDATE()-1
But I get an "incorrect syntax near ')'" error when parsing or trying to run it. Any thoughts?
Try this:
DECLARE @date DATETIME;
SET @date = GETDATE()-1;
execute insertMostRecentUpdate
@Data='Data',
@Date=@date;
You cannot use GETDATE()
as inline-function while calling a procedure.