![]() |
![]() |
We are currently migrating this forum over to our HelpSystems domain. Please post all new threads in our new HelpSystems Community Portal. |
![]() |
|
![]() |
AutoMate Discussion | ![]() |
help :
faq :
home
|
||
Latest News:
|
latest topics : statistics |
Topic Title: Dataset Bulk Dump Topic Summary: Is it possible to bulk dump records from a dataset to a text file. Created On: 04/21/2015 02:37 PM Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() Answer: Phillip, If you are using a SQL user, you have to specify the username and password within the connection string anyway. You can build the script on the fly but you will still need to specify the password within a variable. Your initial request did not mention that the filename is within the records. You can still do a separate query to get the file name so that you can rename the dump file after. Unfortunately, this is the only other viable option without having to interact with SQL Management Studio or other 3rd party application. | ||||||||||||
![]() |
||||||||||||
Hi there,
I am extracting data from a SQL Server database. It is populating a dataset with 100K+ records. At present I am looping through the records and writing them to a text file, resulting in a 14Mb file. Is there a way to do a bulk dump of the dataset instead of looping through it? Cheers
|
||||||||||||
|
||||||||||||
![]() |
||||||||||||
Phillip,
Are you familiar with PowerShell? I have attached a PowerShell script that is referenced in the steps below. Please edit the file and update the following lines: $Database = "bpa10" $Server = "lamabile\sqlexpress" $User = "user" $Password = "password" $AttachmentPath = "C:\test\SQLData.csv" $SqlQuery = "SELECT * FROM dbo.automateconstructs" You will also need to update step 2 of the below task to reference the correct location of the .ps1 file. Once you have made the appropriate updates, the script will generate a .csv file with your SQL query results.
Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
------------------------- ![]() Leonard Amabile | Director, Cross Platform Support AutoMate | InterMapper | Skybot | Divisions of HelpSystems T: +1.213.738.1700 | F: +1.213.738.7665 |
||||||||||||
|
||||||||||||
![]() |
||||||||||||
Leonard
Thanks for the resposnse.
is there another viable option?
|
||||||||||||
|
||||||||||||
![]() |
||||||||||||
Phillip,
If you are using a SQL user, you have to specify the username and password within the connection string anyway. You can build the script on the fly but you will still need to specify the password within a variable. Your initial request did not mention that the filename is within the records. You can still do a separate query to get the file name so that you can rename the dump file after. Unfortunately, this is the only other viable option without having to interact with SQL Management Studio or other 3rd party application.
------------------------- ![]() Leonard Amabile | Director, Cross Platform Support AutoMate | InterMapper | Skybot | Divisions of HelpSystems T: +1.213.738.1700 | F: +1.213.738.7665 |
||||||||||||
|
AutoMate Discussion
» AUTOMATE » AutoMate 7
»
Dataset Bulk Dump
|
![]() |
FuseTalk Enterprise Edition v4.0 - © 1999-2021 FuseTalk Inc. All rights reserved.