problem importing data from .xls to DB table

  • 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???

  • 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.

  • what exactly should I change there?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply