Constraint Violating Yak Guru
Posted - 02/14/2013 : 10:44:57
| I have a query that is using a linked server to an Excel worksheet. When I run the query from Management studio it works fine. When I try to run it using osql I get the following error.
Building the Linked Excel Connection...
1> 2> 3> 4> 5> 6> 7> 8> 9> 10>
Logging into the Linked Excel Connection...
Msg 7399, Level 16, State 1, Server SQLSERVER1, Line 10
The OLE DB provider "Microsoft.ACE.OLEDB.12.0" for linked server
"PriceDataBase" reported an error. The provider did not give any
information about the error.
Msg 7303, Level 16, State 1, Server SQLSERVER1, Line 10
Cannot initialize the data source object of OLE DB provider
"Microsoft.ACE.OLEDB.12.0" for linked server "PriceDataBase
Here is what is in my batch file to kick off the script:
osql -U sa -P password1 -S SQLSERVER1 -i RetrieveFromES.sql -o RetrieveFromES_log.txt
When logged in as administrator I can run the batch file with no errors.
One option I was thinking of. Is there a way to have a user get into Management studio to only run Queries? Kind of like SQL 2000 and Query Analyzer?