sql-server - 如何将变量传递给 SSDT 2017 中的 ODBC SQL 命令?

我找不到将参数传递给 ODBC 源的选项?我可以看到很多与此相关的文章,但我在数据流任务表达式中找不到相同的选项。 [ODBC Source].[SqlCommand] 不在数据流任务中。

我引用的文章如下:

  • > How do I pass a variable to ODBC SQL Command in BIDS?

有人可以帮忙吗?

最佳答案

我认为由于 Visual Studio、SSDT 和 SQL Server 版本之间的不匹配,该属性丢失了。首先,您必须检查您使用的是相关且合适的版本,您可以查看以下链接以获取更多信息:

  • Previous releases of SQL Server Data Tools (SSDT and SSDT-BI)
  • Installing Integration Services Versions Side by Side
  • SQL Server Integration Services SSIS Versions and Tools

同时尝试检查包目标服务器版本:

  • SSDT VS2015 Gotcha – Target Server Version – new feature
  • How to change TargetServerVersion of my SSIS Project

类似问题链接

  • ODBC Source properties are missing in the Data Flow Task expressions dialogue

更新1

在搜索此问题时,我发现 [ODBC Source].[SqlCommand] 属性可能在 2012(2005、2008)之前的版本中找不到,但我找到了一个提到的链接解决方法:

You can easily put in params if the source is an OLE DB source, but what if it is an ODBC Source? You have to use the DataReader source, and you can’t easily set params – like a WHERE statement. You HAVE to use Expressions in order to have a query with a dynamic WHERE statement or passing in a variable as WHERE statement filter.

So, throw a DataFlow on your package, and inside that, throw a DataReader source, and then set the connection to your ODBC Connection (ADO.NET Connection) and set the command text.

  • SSIS – Two Ways Using Expressions Can Make Your Life Easier – Multi DB Select, Non Standard DB Select

https://stackoverflow.com/questions/54519834/

相关文章:

c++ - 如何在 Visual Studio Code 中构建和运行作为发布版的 C++ 应用程序

firebase - 为什么我的 Xamarin.iOS 应用程序没有收到来自 Google Fir

listview - 只允许扩展一个 ExpansionTile

spring - 多部分文件(未给定条件)。错误 400(错误请求)

graphql - Shopify graphql 客户创建

laravel - 无法使用 npm run production 在生产环境中编译 Assets

git - Jenkins 管道在远程源提取期间失败(无法更新本地引用)

c# - try-catch 在 IL 中如何工作?

python - GAE : Why does GAE perform worse than nor

node.js - Express Session cookie 未保存在 Chrome 中?