sql_server thread: Problem with saving stored procedure...
> how to fix.
> assign a new temp table name when the statement is false.
But I need the same table!!! There's a problem.
So I thought about this problem and I solved the problem with this:
(So my SP is very long for posting to this list, the example is
very simplify, as all my previous examples...)
Create Procedure sp_Example
DECLARE @i int, @StrSQL varchar(500)
SELECT @i = 1
IF @i = 2
SELECT @StrSQL = 'SELECT * INTO #TempTbl FROM Goods'
SELECT @StrSQL = 'SELECT * INTO #TempTbl FROM Goods_new'
Thanx all for your efficient help.
> Create Procedure sp_Example
> DECLARE @i int
> SELECT @i = 1
> IF @i = 2
> SELECT * INTO #TempTbl FROM Goods
> SELECT * INTO #TempTbl2 FROM Goods_new
> Renante Jimenez Milan
> Development Group
> AccountMate Philippines, Inc.