Hi All,
I am running below code in SSIS Execute SQL Task and Passing an input parameter to code. My connection is OLEDB connection so I am using ? but it is failing with error message: "failed with the following error: "Syntax error or access violation". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly."
DECLARE @TableDatePartName TABLE
(DatePartName VARCHAR(20))
INSERT INTO @TableDatePartName (DatePartName)
VALUES
(?)
SELECT * FROM @TableDatePartName
I learnt from this thread that it can be problem with SQL Server SP. It is failing when I run this pointing to SQL server 2012 "Microsoft SQL Server 2014 (SP3) (KB4022619) - 12.0.6024.0 (X64) Sep 7 2018 01:37:51 Copyright (c) Microsoft Corporation Enterprise Edition: Core-based Licensing (64-bit) on Windows NT 6.3 <X64> (Build 9600: )" but same code works when I run against SQL Server 2016.
https://social.msdn.microsoft.com/Forums/sqlserver/en-US/8ea3ab6a-d284-4c73-ac5d-d3cdd92f0d0b/execute-sql-task-executing-the-query-quotexec-quot-failed-with-the-following-error?forum=sqlintegrationservices