469,654 Members | 1,827 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,654 developers. It's quick & easy.

Create Temp talbe

I'm trying to create a temp table in the stored procedure.
the syntex is the following:

create st_proc

variables declared

if something >0

create temp table #Table1

if something <0

create temp table #Table1
SQL Compiler complains about the second create.
thanks
Jul 20 '05 #1
1 1534
Liya (al***@optonline.net) writes:
I'm trying to create a temp table in the stored procedure.
the syntex is the following:

create st_proc

variables declared

if something >0

create temp table #Table1

if something <0

create temp table #Table1
SQL Compiler complains about the second create.


In the same procedure having two CREATE TABLE statements for the table
is a quite unsual thing to do, and as you have found out, it is not even
really possible.

I suggest that you tell us about the real business problem and you might
get a solution for it.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by James Proctor | last post: by
1 post views Thread by James Proctor | last post: by
8 posts views Thread by sithellaneous | last post: by
2 posts views Thread by Krustov | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.