SSIS - Export Procedure Results To Csv && Zip
Mar 19, 2007Hello,
Is it possible to use SSIS to export a stored procedure's results to csv & zip the csv?
Thanks!
Hello,
Is it possible to use SSIS to export a stored procedure's results to csv & zip the csv?
Thanks!
I have used BCP to perform this, but I now need an SSIS package. Is this possible to use an SSIS package to automate the task?
View 1 Replies View RelatedHi,
I am trying to create a DTS package that uses a sql stored procedure to generate a set of results and export those results to an excel spreadsheet on a server.
The trick is that the stored procedure accepts a parameter for Bank_Number (there are 10 of them). Therefore i was wondering if there was a way to somehow create the package to run the stored proc 10 times, each with a different bank number as the parameter and generate 10 different excel spreadsheets, one for each bank with it's results.
Can this be done using DTS or do i have to try another method?
thanks
scott
I'm executing Oracle procedure, which has three OUTPUT parameters and returns results in table type variable. i should not use ODBC, MSDAORA providers to call the procedure. So I'm planning to using Oracle OLEDB provider. I'm able to execute the procedure successfully, but when i do check (while dr.Read()) its not returning any records. But I know as per stored procedure results, it should return 66 records.
Dim conn As New OleDbConnection
Dim cmd As New OleDbCommand
Dim dr As OleDbDataReader
Dim QSQL As String
[code]...
Hi,
Based on the "SQL Book Server Online" from MSSQL 2000 I wrote the following codes in order to export the search results in XML format.
se pubsselect 1 as tag, null as parent, stor_id as [store!1!stor_id], stor_name as [store!1!stor_name], null as [Order!2!Ord_Num], null as [Order!2!ord_date] from storesunion allselect 2 as tag, 1 as parent, sa.stor_id, null, sa.ord_num, sa.ord_datefrom sales sajoin stores ston sa.stor_id = sa.stor_idorder by [store!1!stor_id], [Order!2!Ord_Num]for xml explicit
The problem is that I want to results to be something like:
<stores> <store> <stor_id>6380</stor_id> <stor_name>Eric the Read Books </stor_name> <order> <ord_num>A2976</ord_num> <ord_date>1994-09-14 00:00:00.000</ord_date> </order> <order> <ord_num>722a</order_num> <ord_date>1994-09-13 00:00:00.000</ord_date> </order> </store> <store> <stor_id>7066</stor_id> <stor_name>Barnum's</stor_name> <order> <ord_num>6871</ord_num> <ord_date>1993-05-24 00:00:00.000</ord_date> </order> <order> <ord_num>QA7442.3</ord_num> <ord_date>1994-09-13 00:00:00.000</ord_date> </order> </store></stores>
How can I get the results in this format?
And, also, how can I export them directly into an xml file and save it on the disk?
Thank you in advance for your answers.
How can I export my query results to PDF file?
View 3 Replies View RelatedI have been trying to find a way to export the results of a query to a csv for use in excel but cannot.
View 2 Replies View RelatedI am experiencing some quirks when exporting to PDF.
I have read all the other posts about page sizes, margins, etc and my situation seems to be a bit different.
PageWidth = 21cm
PageHeight = 29.7cm
Margins = 1cm
Body.Width = 19cm
I have a report that contains a bar chart (Height = 15cm, Width = 19cm) and below that a rectangle that contains two text boxes with totals information (Left = 11.6cm, Width = 7.4cm, Height 0.5cm)
Now most of the time it exports to PDF perfectly - all on one page as would be expected
If however the chart has more than say 20 items on the y-axis then the rectangle gets pushed onto an new page.
For extra information, but not to confuse the issue I also have a page header and footer that have items lined up right to the edge (left + width = 19cm) and they all display fine on the one page. It is just this rectangle that is having the problem.
When I move the rectangle to the left a bit (11.4cm) so 0.2cm away from the right hand edge then it works fine.
It is just very strange because I cant see how it is getting shifted only when the chart contains a lot of items.
Any ideas?
I am running a SQL stored procedure which runs 3 queries on 3 different SQL tables. What is my best option to export the results of these 3 queries to excel?
If it matters they are all SELECT queries, and at most will return < 500 rows.
Hi,
In SQL Server,
does anybody provide the steps for create a Package for exporting the query results to Excel environment?
I just know that click the "Export", then choose the query file to export to Excel.
I want to know how to create the Package to export it.
Please let me know, thanks.
I'm currently trying to using this bcp script to export results to a csv.
USE crm001_spark
GO
EXEC xp_cmdshell 'bcp "SELECT top 10 * FROM [datebasename].dbo.table name]" queryout "C:Customers.csv" -c -b 10000 -t , -T -S [server]datebasename'
and the ERROR that is coming out is
SQLState = 08001, NativeError = -1
NULL
Error = [Microsoft][SQL Native Client]Login timeout expired
Error = [Microsoft][SQL Native Client]SQL Network Interfaces: Error Locating Server/Instance Specified [xFFFFFFFF].
SQLState = 08001, NativeError = -1
Error = [Microsoft][SQL Native Client]An error has occurred while establishing a connection to the server. When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections.
SQLState = S1T00, NativeError = 0
I have checked the server config manager TCP port and it is pointing to the correct port 1433. What else could be causing the error ?
Is it possible to restrict the Users to Export Report Results only to Excel ?
So instead of the default drop down options of csv, pdf, tiff,Web Archive,Web Archive etc... can we get it to just display Excel.
Any help would be appreciated.
Is there a way to export query results to an excel fie and add that file as an attachment in the email? All this has to be done using SQL query and it needs to be automated. My coworker tried using Openrowset and BCP, but it is not working.
View 3 Replies View RelatedI've got a query that returns the data I need. I want to put the query in a stored procedure such that, when the SP runs I get a pipe delimited text file on disk. I don't really want to mess with SSIS, etc. Is there a Q&D way to do this?
View 1 Replies View RelatedWhat destination task do I use from the toolbox that will connect me to AS/400 database through an ODBC? Each one that I try doesn't do it.
Jim
An excel spreadsheet has to be open on Machine B on the network to pull data from a third party tool.
I have to refresh several columns in this spreadsheet every minute with new data.
Every time there is a new data into the columns i.e. columns 7 and 10, the spreadsheet pulls data from the third party tool automatically and populates other columns i.e. columns 12-15.
Then I will have to retrieve the new data from the spreadsheet into sql server 2005.
So first I wrote a query to use to populate the spreadsheet each time with the result using Import Wizard.
It gives an error: 0xc0202009
And I am not sure if my approach for this project is correct?
What do you think?
Thanks
Im trying to create a DTS package to import an Excel spreadsheet in to SQL Server 2005 and them Export to a text file. I have successfully imported the data using the import/export wizard, but I am unsure how to add the step that exports the data into a text file. Any ideas or links to a resource that may help me?
Thanks in advance!
Hi all of you,
I don't think that such thing is possible but either way, I ask, just in case...
We're doing lots of packages which must have the same variables (in terms of datatype, name, etc..)
TIA for that,
An excel spreadsheet has to be open on Machine B on the network to pull data from a third party tool.
I have to refresh several columns in this spreadsheet every minute with new data.
Every time there is a new data into the columns i.e. columns 7 and 10, the spreadsheet pulls data from the third party tool automatically and populates other columns i.e. columns 12-15.
Then I will have to retrieve the new data from the spreadsheet into sql server 2005.
So first I wrote a query to use to populate the spreadsheet each time with the result using Import Wizard.
It gives an error: 0xc0202009
And I am not sure if my approach for this project is correct?
What do you think?
Thanks
Hi,
View 20 Replies View Relateddatagrid. Sorry, I'm new to it. For the few times I've done datagrids in the past, I've built
my own selects and filled the grid. This time I need to use someone elses stored procedure.
I simply don't know how to get the results back into my VB datagrid. Can someone point
me in the right direction? Thanks.
How do I filter the results of a stored procedure?
View 2 Replies View RelatedHi
I am trying to execute a stored procedure (which returns multiple tables) and use these results to populate an Excel file. I am totally lost on how to capture the results and use it. Any help will be appreciated.
Thanks
Hi All
I've been googling this for a while now and can't seem to find any elegant answers.
I'm looking for an automated way to present a FORMATED Excel Spreadsheet to the Customer from a stored procedure output.
Can anyone advise me the best method of doing this - should I / can I assign an Excel Template to the DTS Task output ?
His mind is set on Excel and the formatting is basic and easy to write in a Macro which I've done, but this requires human interaction to finish the task (Automated Run Once on opening etc).
In an ideal world an individual would send an email to the Server with two formated parameters (@FromDate & @ToDate) and would be emailed back a ready formatted S/Sheet. But I believe he would be willing to just select the relevant SpreadSheet for the Daily / Weekly / Monthly periods dumped.
Thanks
GW
Hi everyone
How can I export procedure from sql 2005 to sql 2000. I did'nt see any options to do this. ?? Thanks alot
Can you export the results of a stored procedure using BCP?
If so, what is the syntax? If not, I was trying to convert my SP to a view, but it has a CASE statement within it and so I can't save a view with that (at least not as I've been trying).
Thanks,
Bob Larson
Hi,
I know how I can export a singe stored procedure to a file, clipboard etc..
But I have several stored procedures and I can't multi select them all
What's the best practice to export all stored procedures from a database?
I have Sql Server 2005 Developer Edition and Sql Server Management Studio.I'm trying to import data but there are no options available under "Projects" in SSMS.Do I need to download an update or anything to use this functionality?
Thanks
have now spent 3 days on finding a solution for this problem.
I export data from a table with a money data type column to excel. Before I do the export I'm creating the table in excel with a create table statement in "Execute sql task editor" like this:
CREATE TABLE `test` (
`MYmoney` Currency)
in the datapump I use OLDB source (local sql server) and destination OLE DB connection (excel destination).
When I open up the excel spreadsheet the Mymoney column will show dollar sign. The problem is that it should be Swedish kr currency showing. WHen I'm running the old DTS package in "Microsoft sql server dts designer components" in sql 2005 on the same server this result will be in the currency kr as it should be.
When I'm running the SSIS on my local machine the result also get right.
Any ideas?
Thanks
/Tobbe
Guys,
I am new to SQL Server 2005. I have installed Developer edition. I want to transfer data through DTS which is now SSIS - Sql Server Integration Service I believe.
One question though how do I access SSIS, I am doing normal imports and exports using the wizards. Is there any other interface to access the SSIS??
Please let me know
Thanks
I want to use SSIS to export to a flat file, for various reasons.
However, my flat file has padded out each column to match the number of characters in the DBase column.
See below for example. The first column is char(3), the second is char(9), the third is char(9) etc
How to I get rid off the excess spaces.
What I get
2*852240 *5006 *MPH00095-02 *200709241200*200709241230
2*692677 *5002 *MPH00180-03 *200701181200*200709241230
What I want2*852240*5006*MPH00095-02*200709241200*200709241230
2*692677*5002*MPH00180-03*200701181200*200709241230
We have begun useing SSIS to export data into a Data warehouse.
For continuity of service and testing perposes I wish to export to flat files.
However, although the export seems to work fine, I get alot od spaces in my text file.
It seems to pad out to the exact number of characters in the data base, i.e. Char(3) outputs 1 character plus an extra 2 spaces, char(9) gives me the six characters + 3 spaces.
I cannot change the DBase.
How do I get rid of the extra spaces?
Requirement.
2*852240*5006*MPH00095-02*200709241200*200709241230
2*692677*5002*MPH00180-03*200701181200*200709241230
What I get
2*852240 *5006 *MPH00095-02 *200709241200*200709241230
2*692677 *5002 *MPH00180-03 *200701181200*200709241230
Hi,
I'm trying to create an SSIS package and exporting to excel using data flow task data conversion. (This is the first time I am writing to you and I am doing so since I have spent a lot of time researching this subject. Your blogs were very helpful. I changed the output folder formats in ADVANCED EDITOR and then changed the excel file data types.) I finally got it to work... somewhat!
My exported excel data contains sevearal formats currency, text and DT-I4. However when it exports,the excel file does not retain the datatypes purely. I then inserted an empty row below column names and changed the data types for the fields. It has worked so far for only currency data types. The text fields are still in general format. There's still the issue of the empty line which best be removed. I also need to e-mail this spreadsheet.
Please help with the datatypes.
Thanks much in advance!
svmadhu.