Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
ucal
Yak Posting Veteran
72 Posts |
Posted - 2009-01-21 : 19:53:02
|
| Hi All,I have a SP that process data and stores the results in a tableTableA.My qustion is: How do I ouput the contents of this table to Excel within my SP.CREATE procedure SpTableAASSELECT * INTO TableA FROM TableX--Will like to Write TableA to an Excel File.Any assistance will be welcomed. |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-01-21 : 19:55:02
|
| You can use Openrowset,Opendatasource,Linked Server or SSIS for it. |
 |
|
|
ucal
Yak Posting Veteran
72 Posts |
Posted - 2009-01-22 : 07:39:20
|
| I have not used Openrowset before , can somebody point me in the right direction. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-01-22 : 07:47:26
|
Should be some stuff like this:insert into OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=c:\yourexeceldestinationfilename.xls;', 'SELECT * FROM [worksheet$]') select * from TableXYou can search for openrowset in this forum...Webfred No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-01-22 : 09:22:13
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/import-export-to-excel.aspx |
 |
|
|
|
|
|