Answered by:
Dynamic file generation

Question
-
Hi ,
I want to create a parent , child directory and create a .txt file (named as TABLE_05022018) dynamically and write a result
of select statement in a child directory text File.is it feasible
like
Folder_parent --> Folder_child ->employee.txt(Result of select query)Thanks in advance
Monday, February 5, 2018 4:55 AM
Answers
-
Hi ,
I want to create a parent , child directory and create a .txt file (named as TABLE_05022018) dynamically and write a result
of select statement in a child directory text File.is it feasible
like
Folder_parent --> Folder_child ->employee.txt(Result of select query)Thanks in advance
Its possible using tool like SSIS
Using T-SQL would require you to use extended procedures for this purpose which is not recommended
SSIS has File System Task available which natively supports file operations. Using this you can create folders as well as files.
See
http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/63152/
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
----------------------------
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page- Proposed as answer by Teige Gao Monday, February 26, 2018 2:37 AM
- Marked as answer by Olaf HelperMVP Friday, April 13, 2018 4:00 PM
Monday, February 5, 2018 5:39 AMAnswerer
All replies
-
Refer following link where mention create dynamic file
https://www.sqlshack.com/creating-dynamically-generated-csv-files-containing-sql-server-data/
https://social.technet.microsoft.com/wiki/contents/articles/37872.sql-server-installation-on-centos-linux.aspx
Monday, February 5, 2018 5:16 AM -
Hi ,
I want to create a parent , child directory and create a .txt file (named as TABLE_05022018) dynamically and write a result
of select statement in a child directory text File.is it feasible
like
Folder_parent --> Folder_child ->employee.txt(Result of select query)Thanks in advance
Its possible using tool like SSIS
Using T-SQL would require you to use extended procedures for this purpose which is not recommended
SSIS has File System Task available which natively supports file operations. Using this you can create folders as well as files.
See
http://www.sqlservercentral.com/articles/Integration+Services+(SSIS)/63152/
Please Mark This As Answer if it solved your issue
Please Vote This As Helpful if it helps to solve your issue
Visakh
----------------------------
My Wiki User Page
My MSDN Page
My Personal Blog
My Facebook Page- Proposed as answer by Teige Gao Monday, February 26, 2018 2:37 AM
- Marked as answer by Olaf HelperMVP Friday, April 13, 2018 4:00 PM
Monday, February 5, 2018 5:39 AMAnswerer