SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
Search:  
 
 
        
Home       Members    Calendar    Who's On



problem importing data from .xls to DB table Expand / Collapse
Author
Message
Posted Friday, September 26, 2008 10:48 AM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, December 20, 2008 5:33 AM
Points: 16, Visits: 123
Hi,

I use
SELECT * 

FROM

OPENROWSET('Microsoft.Jet.OLEDB.4.0',

'Excel 8.0;Database=C:\users.xls',

'SELECT * FROM [sheet2$]')


and I get

Msg 15281, Level 16, State 1, Line 1
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. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.

...it says I must use sp_configure but dont know how and I am very tired can you help???
Post #577016
Posted Friday, September 26, 2008 11:14 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: Administrators
Last Login: Today @ 11:41 AM
Points: 19,451, Visits: 5,034
I edited your post so it wouldn't require so much scrolling.

http://msdn.microsoft.com/en-us/library/ms188787.aspx

sp_configure changes options. OR you can use SSMS and right click the server, properties, adjust the values there.

Post #577034
Posted Friday, September 26, 2008 1:34 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Saturday, December 20, 2008 5:33 AM
Points: 16, Visits: 123
what exactly should I change there?
Post #577135
« Prev Topic | Next Topic »


Permissions Expand / Collapse