Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old September 4th, 2007, 09:33 AM
Registered User
Join Date: Jul 2007
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Concatenating local variables into an execute...

Hello there,

I am having a major problem with the following script:

@command = SELECT .... + = [dbo].[t0209_addressTypes].[c0209_addressTypeID_pk]'
                + N' AND ' + @column1 + ' ' + N' LIKE ' + '"' + @value1 +'"'

When I run EXECUTE(@command) the server insists on interpreting @value1 as an object identifier and not a string literal.

What am I doing wrong?

Thank you,

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute Javascript of a non local frame? sunshineyos Javascript How-To 1 September 13th, 2007 06:42 PM
connection.execute and command.execute difference vinod_yadav1919 Classic ASP Databases 0 September 28th, 2005 06:34 AM
CH. 4 Creating Local Variables mcauliff BOOK: Beginning ASP 3.0 1 March 3rd, 2005 03:57 PM
conn.execute,command.execute or rs.open vinod_yadav1919 Crystal Reports 0 January 3rd, 2005 10:26 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.