문제

I need to export the data from a particular table in my database to Excel files (.xls/.xlsx) that will be located into a shared folder into my network. Now the situation is like this -

  1. I need to use SQL SERVER Agent Jobs. 2.I need to generate a new excel file in every 2 minutes that will contain the refreshed data.

    I am using sql server 2008 that doesn't include BI development studio. I'm clueless how to solve this situation. First, I'm not sure how to export the data using jobs because every possible ways I tried had some issues with the OLEDB connection. The 'sp_makewebtask' is also not available in SQL 2008. And I'm also confused how to dynamically generate the names of the files.

    Any reference or solution will be helpful.

도움이 되었습니까?

해결책 2

I found a better way out. I have created a SSIS(SQL Server Integration Services) package to automate the whole Export to Excel task. Then I deployed that package using SQL Server Agent Jobs. This is a more neat and clean solution as I found.

다른 팁

Follow the steps given below :

1) Make a stored procedure that creates a temporary table and insert records to it.

2) Make a stored procedure that read records from that temporary table and writes to file. You can use this link : clickhere

3) Create an SQL-job that execute step 1 and step 2 sequentially.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top