Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why does this not work in sproc but in query analyzer ???
Message
De
22/01/2003 11:27:27
 
 
À
Tous
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Syntaxe SQL
Titre:
Why does this not work in sproc but in query analyzer ???
Divers
Thread ID:
00744286
Message ID:
00744286
Vues:
53
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform