Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How do I import Excel Database to MS SQL 2005?

Posted on 2007-12-01
4
Medium Priority
?
852 Views
Last Modified: 2012-06-21
How do I import Excel Database to MS SQL 2005?

I have two columns A,B in Excel and in MS SQL 2005, I have 2 columns named (DealerMPA,DealerName)
How do I import A,B values to MS SQL 2005?

I used below query and getting an error message
"SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. "

''''''''''''''''''''''''''''''''''''Query'''''''''''''''''''''''''''''''''''''
create proc ExportToExcel
as
begin
    insert into OPENDATASOURCE
    (       'Microsoft.Jet.OLEDB.4.0'
    ,       'Data Source="D:\list.xls";Extended Properties=Excel 8.0')...[A,B]
    select [DealerMPA], [DealerName]
from Dealer
end
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
How do I correct it?
0
Comment
Question by:erin027
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 37

Accepted Solution

by:
bbao earned 500 total points
ID: 20389662
FYI: How to import data from Excel to SQL Server
http://support.microsoft.com/kb/321686
0
 
LVL 75

Expert Comment

by:Anthony Perkins
ID: 20390156
>>How do I correct it?<< Is enabling OPENDATASOURCE an option?
0
 

Author Comment

by:erin027
ID: 20393094
Yes, acperkins.
Can i enable OPENDATASOURCE and CLOSE it after I am done importing the data.
0
 
LVL 75

Assisted Solution

by:Anthony Perkins
Anthony Perkins earned 500 total points
ID: 20393149
You enable OPENDATASOURCE using the Surface Area Configuration tool.  See Surface Area Configuration for Features - Database Engine - Ad Hoc Remote Queries
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

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

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

670 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