简体   繁体   English

如何使用SSIS SQL日志记录和使用SQL Server Table的配置文件?

[英]How do you use SSIS SQL logging and a Config Files using SQL Server Table?

I have created a package in SSIS where I am using the logging option of "SSIS Log provider for SQL Server". 我在SSIS中创建了一个程序包,在该程序包中,我正在使用“ SQL Server的SSIS日志提供程序”的日志记录选项。 I am also using the package configuration of "SQL Server" where I store all the package connection information in a table with the exception of the connections to my log provider and my configuration provider. 我还使用“ SQL Server”的程序包配置,其中将所有程序包连接信息存储在一个表中,但与日志提供程序和配置提供程序的连接除外。 The reason I do this is because I assume the package can't set up a connection to the configuration settings table if I store the information to access it there. 之所以这样做,是因为我假设如果我在其中存储要访问的信息,则程序包将无法建立与配置设置表的连接。 Also FYI, my package properties are set to "DontSaveSensitive". 仅供参考,我的包属性设置为“ DontSaveSensitive”。

Now I know that my package cannot connect to the config files settings that are in a table and it cannot do logging unless it has the connection information that does that. 现在,我知道我的软件包无法连接到表中的配置文件设置,并且除非具有连接信息,否则它无法进行日志记录。 I assume this has to be done in the sql server agent, how do I set that info for the one connection? 我认为这必须在sql服务器代理中完成,如何为一个连接设置该信息?

I suppose the main question is how the heck do I set up a package with SQL logging and a config file in SQL? 我想主要的问题是,如何在SQL中使用SQL日志记录和配置文件来设置程序包?

You create package variables for the connection information, use the variables in expressions for the connection strings in the package, and set the values of those variables when you call the package from the SQL Agent job. 您为连接信息创建程序包变量,将表达式中的变量用于程序包中的连接字符串,并在从SQL Agent作业中调用程序包时设置这些变量的值。

At least that's one way to do it. 至少那是做到这一点的一种方法。

Another is to populate the connection string variable from a config file. 另一个是从配置文件中填充连接字符串变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM