Skip to main content
November 5, 2008
Answered

SQL: how to embed parameter inside quotes for wildcard %

  • November 5, 2008
  • 1 reply
  • 299 views
I would like to know how to modify a SQL statement to embed a parameter inside quotes. I want to use the parameter inside of a statement such as: SELECT * from table WHERE col LIKE '%@parm'

I can get the query to work without the parameter, just not with it?? Is there a CS3 workaround?

Thanks

This topic has been closed for replies.
Correct answer
Well, after plenty of trial and error, it appears I had to edit the parameter itself.

and go from this
Request.Form["TextBox1"] : ""

to this
"%" + Request.Form["TextBox1"] + "%" : ""

yay!


1 reply

Correct answer
November 5, 2008
Well, after plenty of trial and error, it appears I had to edit the parameter itself.

and go from this
Request.Form["TextBox1"] : ""

to this
"%" + Request.Form["TextBox1"] + "%" : ""

yay!