Solved

Exporting from SQL Server to Excel

Posted on 2014-10-10
6
113 Views
Last Modified: 2014-10-20
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
Comment
Question by:upobDaPlaya
  • 2
  • 2
  • 2
6 Comments
 
LVL 25

Expert Comment

by:jogos
ID: 40374646
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
 
LVL 3

Assisted Solution

by:prequel_server
prequel_server earned 200 total points
ID: 40381367
can be probably be done using SSIS, and/or SSRS. Interested in how?
0
 

Author Comment

by:upobDaPlaya
ID: 40387968
Whats involved using SSIS..would I need to load any special files on my computer ?
0
Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

 
LVL 25

Accepted Solution

by:
jogos earned 300 total points
ID: 40388069
0
 

Author Closing Comment

by:upobDaPlaya
ID: 40393504
Note sure what route I will head..Will first do some more research based on the information provided above..
0
 
LVL 3

Expert Comment

by:prequel_server
ID: 40393537
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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql server Transfering records getting error #NAME? 6 39
Help writing a query 6 71
grouping logic 6 46
T-SQL: Nested CASE Statements 4 24
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

914 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now