Solved

MS SQL Server Deploy Stored Procedures

Posted on 2014-11-27
2
287 Views
Last Modified: 2014-11-30
Without being too technical about, I would like to know the usual steps that are taken to deploy a Stored Procedure (Ex. A query that pulls the overnight orders) so that the Server (Windows) can trigger the Stored Procedure at a specified time and perhaps save a csv copy of this file in a predefined location.
0
Comment
Question by:Benki Canoso
2 Comments
 
LVL 18

Expert Comment

by:Simon
ID: 40469766
It could be as simple as adding the stored procedure to the database then creating a single-step job that calls it and scheduling the job as desired.
Pinal Dave's article on exporting to CSV covers the file export nicely.

Edit: Also see previous thread on EE
scheduled export to csv
0
 
LVL 7

Accepted Solution

by:
Dung Dinh earned 500 total points
ID: 40469928
Hi,

In case, your .csv files is on local server, I mean that your data source  and csv files are on the same server you can use the solutions as SimonAdept's suggestion.

However, if your data source is from another server or you want to export .csv files and transfer them to anywhere, you should use SSIS tool. Because, it gives you the simpler / more flexible methods to help you export .csv file.

Create one SSIS package and call your store procedure. After then, you need also create a SQL job to call the package. You can see image below, I use 2 components File System Task and FPT Task. One is for copying file in local network and another is for copying file in external network. With File System Task, I will copy file to D:\ExportCSV\ folder after exporting data.
ExportCSVFiles.PNG
You can refer to article Exploring SSIS - Export to csv file for more detail.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question