Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why does this not work in sproc but in query analyzer ???
Message
From
22/01/2003 11:27:27
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
Why does this not work in sproc but in query analyzer ???
Miscellaneous
Thread ID:
00744286
Message ID:
00744286
Views:
42
In QA I can put in the following:

SET QUOTED_IDENTIFIER OFF

DECLARE @pForm_Id NVARCHAR(50),
@tsql1 NVARCHAR(4000)

SET @pForm_ID = 'TEST_FORM_01' --This will be a param in the sproc

SET @tsql1 = 'SELECT lbl_text FROM MetaLabel WHERE lbl_frm_id = ' + "'" + @pFrm_id + "'"

EXEC (@tsql1)

This works fine above in QA, but if I put the same in an sproc I can't even save it because of 'Invalid column "' message.

If I try 'lbl_frm_id = ' + @pFrm_Id gives me "TEST_FORM_01" is not a valid column when I run the sproc, however this will let me save the sproc.

I have had stuff like this run fine before and I'm even cutting and pasting old code over that is indentical to this that works fine, but for some reason I can't even save the sprocs.

Any clues ???

TIA !!!
Jace
Next
Reply
Map
View

Click here to load this message in the networking platform