Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Help! - Dynamic SQL problem in SQL Server

Help! - Dynamic SQL problem in SQL Server

From: <kal121_at_yahoo.com>
Date: Thu, 18 Mar 1999 22:01:15 GMT
Message-ID: <7crt31$cd8$1@nnrp1.dejanews.com>


Hi all,

Here's a simple procedure I am trying to run:



CREATE PROC my_proc (@table_name_in VARCHAR(255), @id_in INT) AS

TRUNCATE TABLE my_table

exec ('INSERT INTO my_table SELECT id FROM ' + @table_name_in + ' WHERE id <= ' + @id_in)

exec ('DELETE FROM ' + @table_name_in + ' WHERE id <= ' + @id_in)

go


Invalid column name 'n'.

It says this in reference to both exec statements. I have no idea what the problem is. Any clues?

Thanks.

-----------== Posted via Deja News, The Discussion Network ==---------- http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own Received on Thu Mar 18 1999 - 16:01:15 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US