Skip to content

Integration Services 学习

执行 SQL 任务中使用参数

之前根据网上文章使用了 @<参数名称> 形式的参数,查了好久才发现只有 ADO.NET 中才能使用这种形式的参数。

参考:https://technet.microsoft.com/zh-cn/library/cc280502(v=sql.110).aspx

连接类型参数标记参数名称示例 SQL 命令
ADO?Param1, Param2, …SELECT FirstName, LastName, Title FROM Person.Contact WHERE ContactID = ?
ADO.NET@<参数名称>@<参数名称>SELECT FirstName, LastName, Title FROM Person.Contact WHERE ContactID = @<parmContactID>
ODBC?1, 2, 3, …SELECT FirstName, LastName, Title FROM Person.Contact WHERE ContactID = ?
EXCEL 和 OLE DB?0, 1, 2, 3, …SELECT FirstName, LastName, Title FROM Person.Contact WHERE ContactID = ?

在 OLE DB 连接管理器中使用日期和时间参数

  • NVARCHAR 数据类型的输入参数

    之前没注意到这句话,试了所有的日期类型,单数仍然没有传递进去。

  • 具有相应数据类型的输出参数,如下表中所示。

Output 参数类型Date 数据类型
DBDATEdate
DBTIME2time
DBTIMESTAMPdatetime,datetime2
DBTIMESTAMPOFFSETdatetimeoffset

数据流 - 查找

  • 只能使用 OLE DB 连接管理器?

    • 看连接类型中只能选择:

      • 缓存连接管理器

      • OLE DB 连接管理器

事务

  1. https://www.mssqltips.com/sqlservertip/1585/how-to-use-transactions-in-sql-server-integration-services-ssis/

  2. https://technet.microsoft.com/zh-cn/library/ms137690(v=sql.110).aspx

部署

  1. https://technet.microsoft.com/zh-cn/library/hh213290(v=sql.110).aspx

    • 创建 SSIS 目录需要通过 Windows 认证登录 (把自己的域用户加到 DB 就行了)

    • 发布也需要域用户登录,并且默认的 public 角色权限不够,我加了 sysadmin 权限

    • 添加包定时执行参照了官方文档和下面的文章

参考

Page Layout Max Width

Adjust the exact value of the page width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the page layout
A ranged slider for user to choose and customize their desired width of the maximum width of the page layout can go.

Content Layout Max Width

Adjust the exact value of the document content width of VitePress layout to adapt to different reading needs and screens.

Adjust the maximum width of the content layout
A ranged slider for user to choose and customize their desired width of the maximum width of the content layout can go.