Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

MS SQL Server Deploy Stored Procedures

Posted on 2014-11-27
2
Medium Priority
?
325 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 8

Accepted Solution

by:
Dung Dinh earned 2000 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

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
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.

876 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