Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Data Export to Excel without using DTS or SISS

 
   Database Forums (Home) -> Programming RSS
Next:  Help  
Author Message
bcap

External


Since: Jun 24, 2008
Posts: 158



(Msg. 1) Posted: Tue Jun 28, 2011 8:41 am
Post subject: Data Export to Excel without using DTS or SISS
Archived from groups: microsoft>public>sqlserver>programming (more info?)

To all:

I need to create a Stored Procedure that will take a query and export
it to Excel. I also need the Excel file to have a timestamp making
each file unique upon creation.

I have attempted to use the bcp utility, however you cannot export to
Excel using this method.
I have attempted an OPENROWSET, however this method requires having a
file existing.

I would sincerely appreciate any suggestions, links, or example on how
to be able to export to Excel with DTS/SISS in an SPROC that would
allow creating the Excel on the fly.

Thank you in advance.

 >> Stay informed about: Data Export to Excel without using DTS or SISS 
Back to top
Login to vote
Bob Barrows

External


Since: Jan 25, 2011
Posts: 3



(Msg. 2) Posted: Tue Jun 28, 2011 11:51 am
Post subject: Re: Data Export to Excel without using DTS or SISS [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

bcap wrote:
> To all:
>
> I need to create a Stored Procedure that will take a query and export
> it to Excel. I also need the Excel file to have a timestamp making
> each file unique upon creation.
>
> I have attempted to use the bcp utility, however you cannot export to
> Excel using this method.

So export to a csv or txt file either of which can be opened in Excel.

> I have attempted an OPENROWSET, however this method requires having a
> file existing.
>
> I would sincerely appreciate any suggestions, links, or example on how
> to be able to export to Excel with DTS/SISS in an SPROC that would
> allow creating the Excel on the fly.
>
Create a package that does your export
http://www.google.com/search?q=ssis+export+to+excel+create+file+dynamic+name

and execute the package from your stored procedure
http://www.google.com/search?q=execute+ssis+package+from+stored+procedure

 >> Stay informed about: Data Export to Excel without using DTS or SISS 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Export Results to Excel - Okay, fairly new to SQL (about 6 months) I am trying to export results from a query into an excel file. I found reference to DTS package... exec master.dbo.xp_cmdshell "DTSRun /ServerName/Login/Password/N/ Query Name" But I keep getting; &q...

Export SQL data to text file - Hi, What is the easiest/best way to export data from a SQL table to a text file (the text file may need to be a comma seperated or a tab seperated file)? This needs to execute automatically overnight. thanks for any help folks, Des.

Right-justify a column on export to text - Hello, I have a column (AccountNo per the below create script) that displays properly with leading zeroes to fill a 22-character column while in SQL. However, when I use a DTS export to a standard text file with no transformation, it left-justifies. ...

import export unsuccessful delete - hey all, i'm in sql2005 and i'm using import wizard where i specify to delete existing records and enable identity insert. for some reason, unknown to me, it's running as though the delete didn't occur and it just adds it anyway. in addition, the..

excel problem - hi I have an excel sheet with no header row. so I used DTS package to transfer data to the table, however, transform data task think my first row is the header column, as the result, I can never transfer my first row data to the table. is there a way t...
   Database Forums (Home) -> Programming All times are: Pacific Time (US & Canada)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]