Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
sqlserverdeveloper
Posting Yak Master
243 Posts |
Posted - 2008-06-02 : 17:02:01
|
I have a stored proc, once the stored proc runs it generates data with respect to different categories for example below is sample data:category1 101category2 103category1 106category3 100category2 110etcSo what I want is place the respective data into the folder wheer it belongs to on the network, for example I want to place all the info of category1 in category1 folder, all the information of category2 in the category2 folder etc...This will run as a scheduled job every morning, please advice how I can do this. Thanks!! |
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-06-02 : 19:57:49
|
Do you mean dump data to different folder? You can use bcp for that if so, ensure sql agent service account has permission to create file in those folders. |
|
|
sqlserverdeveloper
Posting Yak Master
243 Posts |
Posted - 2008-06-03 : 16:40:03
|
Thanks for the response,the output should go in excel format to each category folder. The following is the resultset from the stored proc execution:Column1 Column2 Column3category1 101 NYcategory2 103 Floridacategory1 106 Coloradocategory3 100 Georgiacategory2 110 NJcategory3 200 MinnesotaWe will have folders with the follow names:category1, category2, category3 ... upto category60Since we have 60 categories, so we will have 60 folders.Per the above resultset, 1. The following data should go into category1 folder in excel format:Column2 Column3101 NY106 Colorado2. The following data should go into category2 folder in excel format: Column2 Column3103 Florida110 NJEtc...Please let me know how we can do this as I want to schedule this to run daily morning.Thanks!! |
|
|
rmiao
Master Smack Fu Yak Hacker
7266 Posts |
Posted - 2008-06-03 : 16:50:24
|
You can run bcp in sql job, find detailed syntax in books online. |
|
|
|
|
|