首页 > 解决方案 > SSIS SQL执行任务错误:无法运行一些sql查询

问题描述

我正在制作一些事实表(从一些资源中获取一些数据,进行一些转换并将它们放入一个表中)。我的主要困境是除了选择、更新和插入之外,我无法运行任何 SQL 查询。一旦我尝试:

exec someProcedure

或条件语句 ( if @part1 ...) 甚至 ( create table ...) 我会出错。打开任务以构建我的 SQL 语句并查找问题,它给出的错误范围从(不支持 Set SQL 构造或语句。)到(不支持 EXEC SQL 构造或语句。)。我在 stackoverflow 上寻找了许多主题,但没有一个真正解决了我的问题。

谢谢,

您可以在这张照片中看到我所面临的情况:

在此处输入图像描述

我希望像往常一样在 SSIS 中运行我的 SQL 命令。

标签: sqlsql-serverssisetlssis-2012

解决方案


Try changing the SQL Source Type from Direct Input to Stored Procedure and just specify the stored procedure name instead of Exec stored procedure

Also make sure that you have selected the relevant TargetServerVersion from the project configuration:


Based on your comments, you are using SQL Server 2012 with Visual Studio 2010 which are not compatible.

You have to use Visual Studio 2012 or 2015+ (backward compatibility added). You can refer to the SSIS tag wiki for more info:


推荐阅读