Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 122
  • Last Modified:

Exporting from SQL Server to Excel

Is it possible to export from SQL Server into a new Excel workbook and load the data into mult tabs.

From SQL Server
tbl1
tbl2
tbl3

Into Excel (1 workbook, multiple tabs)
tab1
tab2
tab3
0
upobDaPlaya
Asked:
upobDaPlaya
  • 2
  • 2
  • 2
2 Solutions
 
jogosCommented:
With openrowset you can choose your sheet, but that must be prepared to have all columns of right type already.
insert into OPENROWSET(
        'Microsoft.Jet.OLEDB.4.0', 
        'Excel 8.0;Database=d:\export\prebaredFile.xls;;HDR=YES', 
        'SELECT * FROM [Sheet1$]')
select * from yourtab1

Open in new window

More examples at
http://www.ashishblog.com/importexport-excel-xlsx-or-xls-file-into-sql-server/

There is the ability to import in your excel
http://sqlwithmanoj.com/2009/09/24/create-an-excel-refreshable-report-from-database-pivot-report/
0
 
prequel_serverCommented:
can be probably be done using SSIS, and/or SSRS. Interested in how?
0
 
upobDaPlayaAuthor Commented:
Whats involved using SSIS..would I need to load any special files on my computer ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
upobDaPlayaAuthor Commented:
Note sure what route I will head..Will first do some more research based on the information provided above..
0
 
prequel_serverCommented:
I would say SSIS is your best bet. You can make create multiple data flows all going to different sheets in one Excel workbook.  Post another question asking that specifically so we can help.

Cheers
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now