>SQL Server – Excel 2007 ve Linked Server

>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. That means first you need to enable the ‘Ad Hoc Distributed Queries’.

hatası almamak için önce asagidaki komutlari sirasi ile calistirin

sp_configure ‘show advanced options’, 1
GO
RECONFIGURE WITH OverRide
GO
sp_configure ‘Ad Hoc Distributed Queries’, 1
GO
RECONFIGURE WITH OverRide
GO

daha sonra asagidaki komutu calistirin boylelikle kalıcı Linked Server olusturmadan XSL tablonuzu sorgulayabilirsiniz…

SELECT * FROM OPENROWSET ( ‘Microsoft.ACE.OLEDB.12.0’, ‘Excel 12.0; Database=D:\TEST.xls;HDR=No’, ‘Select * from [Sheet1$]’ )

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s