Getting incorrect syntax error '?' when trying to run the below two lines

Viewed 47

We have an incremental job that keeps only 2 years of data. We have nightly and hourly jobs to get data from the source (using OLE DB Source component).

These two lines were taken from one of the source queries for the datasets.

DECLARE @LastIds NVARCHAR(MAX) = ?
DECLARE @CurrentTrackDBVersionID BIGINT = ?

These two lines are throwing error during execution, how can I make these two lines work?

The error returned is

OLEDB source failed the pre-execute phase and returned error code 0x80040E14
1 Answers

try below

Your Parameter:

DECLARE @LastIds NVARCHAR(MAX) = ?  
DECLARE @CurrentTrackDBVersionID BIGINT = ?

Updated Parameter:

DECLARE @LastIds NVARCHAR(MAX) = null  
DECLARE @CurrentTrackDBVersionID BIGINT = null
Related