Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 175
Default Runnings SQL Queries from excel

Ok, so try calling the table ##table....

Where you run the code from is not relevant - in vb or query analyser. The
session is still there.

--
www.alignment-systems.com


"Mahesh" wrote:

Hi John,
I want to run the queries in the same session. Problem here is i am
not running the queries in the SQL Analyzer. i am running it through excel
using some macros.
E.g: I place a query in one cell and the macro will run the query to
populate the results in new sheet.
so when i give select * from customer it gives the data output
but when i give select * into #temp1 from customer and then run another
query select * from #temp1 it gives an error saying invalid object #temp1.

Can you please help how to get rid of this error and populate the data from
#temp1

Thanks,
Mahesh


"John.Greenan" wrote:

Do you create the temporary table within the same SQL session/connection?
The temporary table is normally only session specific. You could try
creating the temp table as a global temp table - call it ##name rather than
#name



--
www.alignment-systems.com


"Mike Fogleman" wrote:

In my experience you cannot run a new query in the same range as a previous
query. Only a refresh is allowed of the previous query. Either delete the
range of the previous query or use a different, non-overlapping range.
Mike F
"Mahesh" wrote in message
...
Hi,
I am running SQL queries from excel and populate the sheets. I have a
problem when i am running the queries which create temp tables. After i
create temp table and run another query on that temp table (#temp1) it is
giving an error.

Can any one help on this



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel queries Suresh.D Excel Discussion (Misc queries) 1 October 2nd 09 04:08 PM
queries in excel gaby elia Excel Discussion (Misc queries) 2 June 2nd 08 01:37 PM
Queries / Excel Ben Adler Excel Programming 1 July 22nd 05 08:43 PM
Web queries and Excel SmilingPolitely[_3_] Excel Programming 0 April 14th 05 08:53 AM
Excel Queries. Dinesh[_2_] Excel Programming 5 September 24th 03 06:18 PM


All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"