1
我有一個基於提供的Id編號編譯一些數據的查詢。我想運行一次以獲得我擁有的一長串ID,並將結果集保存爲CSV。我知道我可以手動完成,但我正在尋找一種自動化的方式。自動保存我的SQL Server查詢結果
我已經試過運行我的查詢,而沒有在where子句中指定Id。這最終導致我的文件比1Gb略小,這對於需求來說太大了。
這裏是什麼,我試圖完成的基本思想:
Declare @num int
set @num = 0
While @num < 100
Begin
--I'm trying to figure out a way to store the
--result set generateed by this procedure is saved to 'DataExtract' + @num + '.csv'
Exec LongRunningProcedure @num
Set @num = @num + 1
End
的資源就是http://billfellows.blogspot.com/2011/03/powershell-export-query-to-csv.html – jwhaley58
我能夠這樣很容易適應我的需要,謝謝! – Curtis