Hi @Anjali Shah ,
You may use Script Task for a try as shown below.
You may also use SSIS, Biml, and BCP to meet your requirement.
Check this link: https://www.mssqltips.com/sqlservertip/6010/export-multiple-sql-tables-to-text-files-using-ssis-biml-and-bcp/
Regards,
Zoe
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.