insert into a global temp table using stored procedure

insert into a global temp table using stored procedure

Post by Jasmine Huan » Sat, 09 Jun 2001 02:10:36



Hi,

I'm trying to insert values into a global temp table, which is passed to
sp_p1 as a variable, such

Create Procedure sp_p1 (


)
AS



variable

Any idea of how to fix this?  Thanx.

Jasmine

 
 
 

insert into a global temp table using stored procedure

Post by Francisco Meji » Sat, 09 Jun 2001 02:55:36





this is what is called a dynamic sql statement

Francisco Mejia
Lead Software Architect and Bus Driver
whichever job come first


> Hi,

> I'm trying to insert values into a global temp table, which is passed to
> sp_p1 as a variable, such

> Create Procedure sp_p1 (


> )
> AS



> variable

> Any idea of how to fix this?  Thanx.

> Jasmine


 
 
 

insert into a global temp table using stored procedure

Post by Jasmine Huan » Sat, 09 Jun 2001 03:09:53


Thanks Francisco.
That was what I did at first.  I had




But, this returns an error to the web browser "[Microsoft][ODBC SQL Server
Driver][SQL Server]Syntax error converting the varchar value 'INSERT INTO
##node_tree_table56 VALUES(' to a column of data type int".  I use vbScript
for the client side programming.

I know this must be something very simple, but I'm new to stored procedures
and the reference book i have has no information on this.  HELP!!!

Jasmine





> this is what is called a dynamic sql statement

> Francisco Mejia
> Lead Software Architect and Bus Driver
> whichever job come first



> > Hi,

> > I'm trying to insert values into a global temp table, which is passed to
> > sp_p1 as a variable, such

> > Create Procedure sp_p1 (


> > )
> > AS



> > variable

> > Any idea of how to fix this?  Thanx.

> > Jasmine

 
 
 

insert into a global temp table using stored procedure

Post by Erland Sommarsk » Mon, 11 Jun 2001 04:57:08








Apart from that, it might be that you are in for a too complex solution.
Then again, it might be me, because I have never understood what global
temp tables are good for. Anyway, it might be better to have the client
generate a plain vanilla local temp table, and then you don't have to
do dynamic SQL at all.

Hm, true, if you are using disconnected records sets that won't fly,
but you could go for one global temp table, and then address it with
some process key.

--
Erland Sommarskog, Abaris AB

SQL Server MVP

 
 
 

1. A tale of global temp table in BCP in Stored Procedure in SQL Upgrade

The tale as told to me: A stored procedure was exporting from a
global temp table using BCP and running quite happily under SQLServer 6.5.
However, the time came to upgade the SQLServer to 7.0.  And now
the stored procedure goes off into never-never land when it is executed.
Does anyone know if this is a bug? Have you seen similiar problem?
Any ideas for resolution using BCP? I've already suggested to user to try
DTS.

2. ORA-06110 (NETTCP)

3. Problem using shape recordsets with stored procedure that uses a temp table

4. Response to Subject: 25GB tape backup

5. Debugging stored procedures in visual studio stooped working

6. Using SQL Server for IPC data transfers using global temp tables

7. tcu serial network connections

8. Temp table vs Global Temp table

9. Defining a rerunnable SQL Stored Procedures which uses Global Temporary table

10. Creating a Temp table using results from a store procedure

11. Some question about using temp table in stored procedure

12. Problem: Recordset is closed after calling a stored procedure that uses temp tables