Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Procedure problem

Author  Topic 

xpandre
Posting Yak Master

212 Posts

Posted - 2002-02-01 : 04:09:15
I created this procedure:

CREATE PROCEDURE DBO.TEST AS
BEGIN

IF NOT EXISTS(SELECT 1 FROM sysobjects WHERE TYPE='U' AND UPPER(NAME) LIKE TREE_DATA)
BEGIN
SELECT * INTO TREE_DATA FROM T1 WHERE 1=2
END



END
GO


It gives me the following error!
error 207 :Invalid column name "TREE_DATA"

Aint I allowed to execute such commands in a procedure?

Thank you
Sam

Teroman
Posting Yak Master

115 Posts

Posted - 2002-02-01 : 04:42:46
the name TREE_DATA is a string, so you need to put in quotes

... UPPER(NAME) LIKE 'TREE_DATA'

ok?

col

Go to Top of Page

xpandre
Posting Yak Master

212 Posts

Posted - 2002-02-01 : 06:07:01
oops
gee thanx Teroman

Go to Top of Page
   

- Advertisement -