Link to home
Start Free TrialLog in
Avatar of SURESH0518
SURESH0518

asked on

What is the fastest to export output of a storedprocedure to a csv file using PowerShell

I have a SQL SERVER Stored procedure and it takes 4 minutes and output of this stored procedure is around 700k. WHat is fastest way to export to CSV using PowerShell. Any help is appreciated.
Avatar of Elliott Clark
Elliott Clark
Flag of United Kingdom of Great Britain and Northern Ireland image

There's not much detail in your question, therefore I'll assume you just want to know the PowerShell command to export to CSV

Export-Csv c:\temp

Open in new window


at the end of your script and change the location to wherever you wish to CSV file to be exported to
SOLUTION
Avatar of aikimark
aikimark
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I think there have been enough answers already that deserve points rather than just deleting the question.
I think the points should be split:
80% #a42359337
20% #a42359292
Somebody accepted the proposal for the points split as the correct answer! Probably who posted it.

:o)))))