Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
Sagarr Kanoje
Starting Member
1 Post |
Posted - 2010-08-27 : 11:23:55
|
HiI'm tried SELECT * INTO XXX FROM OPENROWSET alongwith Microsoft.ACE.OLEDB.12.0.Apparently the query requires the sql account to have SYSADMIN privileges.Considering that SYSADMIN should not be provided to a database account on a Production Server, I tried using the Linked Server method.Following is my code.Exec sp_addlinkedserver 'AB2','Ace 12.0','Microsoft.ACE.OLEDB.12.0','\\202.46.215.35\sagarr\Test1\cpc\c2\AB2.xlsx',NULL,'Excel 12.0;IMEX=1'Exec sp_addlinkedsrvlogin 'AB2','false',NULL,NULL,NULLgoSELECT * INTO [CPCAB2.xlsx] FROM OPENQUERY([AB2] ,'SELECT * FROM [Sheet1$]')Exec sp_dropserver 'AB2','droplogins'Now i get the following errorError.15247-User does not have permission to perform this actionIf I execute the query from Query Analyzer it works fine, but fails when I execute it using Windows App and encapsulate code in Stored Proc.My Excel file, Database and Windows Application run on separate machines.i have provided the following privilegesGRANT ALTER ANY LOGIN TO sqlaccountGRANT ALTER ANY LINKED SERVER TO sqlaccountEXEC sp_configure 'show advanced options', 1RECONFIGUREEXEC sp_configure 'ad hoc distributed queries', 1RECONFIGUREThe DisAllowAdHocProcess in Registry has value 0Please let me know what additional permissions should i set to get it working???Sagarr Kanoje |
|
|
|
|
|
|