February 21, 2002 at 3:56 am
Hi,
I added another local variable to a stored proc and got the following error:
'Only constants, expressions, or variables allowed here. Column names are not permitted.'
This error referred to the following PRINT statement:
PRINT "There are no records dated after the " + CONVERT(VARCHAR(20),@date) + " for paper ID: " + CONVERT(VARCHAR(6),@paper_id)
This statement was working fine until adding the new variable, removing the PRINT statement resolves the error. Can anyone tell me why this has occured and how do I get my PRINT statement to work again?
TIA
February 21, 2002 at 4:19 am
The double quotes are being interpreted as object identifiers ie referring to tables. If you want to use double quotes, you can insert the statement set quoted_identifier off at teh top of the procedure.
Alternatively, you could use single quotes.
Paul Ibison
Paul Ibison
Paul.Ibison@replicationanswers.com
February 21, 2002 at 4:21 am
Well, it seems that all of a sudden, it decided not to like " chars, changed them them to ' chars and all is well.
PRINT 'There are no records dated after the ' + CONVERT(VARCHAR(20),@date) + ' for paper ID: ' + CONVERT(VARCHAR(6),@paper_id)
Oh well, such is life!
February 22, 2002 at 4:37 am
I have run into this problem with double qoutes and for that reason I avoid them whenever possible.
Robert Marda
Robert W. Marda
Billing and OSS Specialist - SQL Programmer
MCL Systems
February 22, 2002 at 9:57 am
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy