简体   繁体   English

SSIS-从一个sql表导出多个文件。

[英]SSIS - Exporting multiple files from one sql table.

I have about 30 files that will need to be exported from one sql table. 我大约需要从一个sql表中导出30个文件。 What I have now is creating a sql table for each file, then exporting the contents of that individual table. 我现在为每个文件创建一个sql表,然后导出该单个表的内容。 This works fine but I really didn't want to have 30 tables on the server. 这个工作正常,但是我真的不想服务器上有30个表。 Is there a way to export from one table using 30 different sql queries? 有没有一种方法可以使用30个不同的SQL查询从一个表导出?

Thanks in advance 提前致谢

This really depends on your data need and how complicated the export is but... generally people do not create an export table per export. 这实际上取决于您的数据需求以及导出的复杂程度,但是...通常人们不会为每个导出创建一个导出表。 Data Transform Task's source can be a table (which you are currently using) or a stored procedure or a view. 数据转换任务的源可以是表(当前正在使用)或存储过程或视图。

I would need to know more about your structure to advise more accurately but... one table per export is definitely not the best solution. 我需要更多地了解您的结构以更准确地提出建议,但是...每次导出一张表绝对不是最佳解决方案。

I would use a parameterized stored procedure if possible. 如果可能,我将使用参数化的存储过程。

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

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