I keep getting an unexplainable error (see below) when I try to run a simple query in SSIS' OLEDB Command.
My query runs just fine in SQL Server, I made some adjustments to make it simpler to ensure it runs, but to no avail.
DECLARE @Gender [nvarchar](6)
DECLARE @Ready [nvarchar](12)
DECLARE @DOB [datetime]
SET @Gender=?
SET @Ready=?
SET @DOB=?
IF @Gender = 'M'
SET @Gender='Male'
IF @Gender = 'F'
SET @Gender='Female'
IF @Ready='Y'
SET @DOB=NULL
INSERT INTO [dbo].[PHI_CLIENT_PROFILES]
([col43],
[col13],
[col22],
[col10],
[origin]
)
VALUES
(@DOB, @Gender, ?, ?, ?)
ERROR MESSAGE:
Validation error. Data Flow Task: Data Flow Task: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for SQL Server" Hresult: 0x80004005 Description: "Syntax error or access violation"