I'm having some problems running some SQL from an Excel Data Connection (Excel 2007) which connects to Microsoft SQL Server 2008. I set up the connection using Excel's data connection wizard.
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
Basically I'm trying to connect some excel pivots to a database to run some SQL queries which use temp tables.
<o> </o>
For some reason I get the following error and I can't work out what the problem is.
<o> </o>
"The query did not run, or the database table could not be opened.
Check the database server or contact your database administrator. Make sure the external database is available and hasn't been moved or reorganized, then try the operation again."
<o> </o>
<o> </o>
Perhaps it's some kind of permission problem or is there something else I need in my connection string?
<o> </o>
Perhaps the problem occurs because my login account does not have full access to the temporary folder of the SQL Server. Otherwise could it be Excel is not configured to run distributed queries?
<o> </o>
Below is a simple script I'm using to test the process and they run fine in Microsoft Server Management Studio
<o> </o>
Select top(10)*<o></o>
into ##Test<o></o>
from Atlasrpt.dbo.GMGRA_GRANT<o></o>
select * from ##Test
<o> </o>
Other code I'm trying is:
<o> </o>
Select top(10)*<o></o>
into UsrTemp.dbo.Test<o></o>
from Atlasrpt.dbo.GMGRA_GRANT<o></o>
select * from UsrTemp.dbo.Test<o></o>
drop table UsrTemp.dbo.Test<o></o>
<o> </o>
If I use the above second SQL code it will create the table and write records to the UsrTemp database but it still gives me the error below and won't read the records back into my Pivot Table.
<o> </o>
Below is my connection String:
<o> </o>
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=ATLASRPT;Data Source=lac-rptsqln-08;Extended Properties="Retainsameconnection = true;delayvalidation = true";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=CENTDAUD82605XY;Use Encryption for Data=False;Tag with column collation when possible=False<o></o>
<o> </o>
Any help would be greatly appreciated!
<?xml:namespace prefix = o ns = "urn:schemas-microsoft-comfficeffice" /><o> </o>
Basically I'm trying to connect some excel pivots to a database to run some SQL queries which use temp tables.
<o> </o>
For some reason I get the following error and I can't work out what the problem is.
<o> </o>
"The query did not run, or the database table could not be opened.
Check the database server or contact your database administrator. Make sure the external database is available and hasn't been moved or reorganized, then try the operation again."
<o> </o>
<o> </o>
Perhaps it's some kind of permission problem or is there something else I need in my connection string?
<o> </o>
Perhaps the problem occurs because my login account does not have full access to the temporary folder of the SQL Server. Otherwise could it be Excel is not configured to run distributed queries?
<o> </o>
Below is a simple script I'm using to test the process and they run fine in Microsoft Server Management Studio
<o> </o>
Select top(10)*<o></o>
into ##Test<o></o>
from Atlasrpt.dbo.GMGRA_GRANT<o></o>
select * from ##Test
<o> </o>
Other code I'm trying is:
<o> </o>
Select top(10)*<o></o>
into UsrTemp.dbo.Test<o></o>
from Atlasrpt.dbo.GMGRA_GRANT<o></o>
select * from UsrTemp.dbo.Test<o></o>
drop table UsrTemp.dbo.Test<o></o>
<o> </o>
If I use the above second SQL code it will create the table and write records to the UsrTemp database but it still gives me the error below and won't read the records back into my Pivot Table.
<o> </o>
Below is my connection String:
<o> </o>
Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Initial Catalog=ATLASRPT;Data Source=lac-rptsqln-08;Extended Properties="Retainsameconnection = true;delayvalidation = true";Use Procedure for Prepare=1;Auto Translate=True;Packet Size=4096;Workstation ID=CENTDAUD82605XY;Use Encryption for Data=False;Tag with column collation when possible=False<o></o>
<o> </o>
Any help would be greatly appreciated!