Is there anyway without using a EXEC and a dynamic query (text string
concatanated) to say used this column and compare it... like I want to do
this
'WHERE ' + @.columnToSearch + ' like ''' + @.query + '%'')'
just not as a concatanaged string... the @.columnToSearch is a user picked
column in the application from a listing of possible choices like address,
city, street, etc then they do a text search on it to find similar ones that
start with what they typed into the applications text box. but right now i
can only get it to work using a string build like above and executed by the
EXEC command. I want to get rid of all dynamic SQL in my application though,
anyone have any suggestions? thanks!Brian
This is very good that you want to get rid of dynamic sql
http://www.sommarskog.se/dyn-search.html
"Brian Henry" <nospam@.nospam.com> wrote in message
news:ekc4OqxpFHA.1968@.TK2MSFTNGP14.phx.gbl...
> Is there anyway without using a EXEC and a dynamic query (text string
> concatanated) to say used this column and compare it... like I want to do
> this
> 'WHERE ' + @.columnToSearch + ' like ''' + @.query + '%'')'
> just not as a concatanaged string... the @.columnToSearch is a user picked
> column in the application from a listing of possible choices like address,
> city, street, etc then they do a text search on it to find similar ones
> that start with what they typed into the applications text box. but right
> now i can only get it to work using a string build like above and executed
> by the EXEC command. I want to get rid of all dynamic SQL in my
> application though, anyone have any suggestions? thanks!
>|||See more here
http://www.sommarskog.se/dynamic_sql.html|||Start here
http://www.sommarskog.se/dynamic_sql.html
Roji. P. Thomas
Net Asset Management
http://toponewithties.blogspot.com
"Brian Henry" <nospam@.nospam.com> wrote in message
news:ekc4OqxpFHA.1968@.TK2MSFTNGP14.phx.gbl...
> Is there anyway without using a EXEC and a dynamic query (text string
> concatanated) to say used this column and compare it... like I want to do
> this
> 'WHERE ' + @.columnToSearch + ' like ''' + @.query + '%'')'
> just not as a concatanaged string... the @.columnToSearch is a user picked
> column in the application from a listing of possible choices like address,
> city, street, etc then they do a text search on it to find similar ones
> that start with what they typed into the applications text box. but right
> now i can only get it to work using a string build like above and executed
> by the EXEC command. I want to get rid of all dynamic SQL in my
> application though, anyone have any suggestions? thanks!
>|||http://www.sommarskog.se/dynamic_sql.html
http://www.sommarskog.se/dyn-search.html
"Brian Henry" <nospam@.nospam.com> wrote in message
news:ekc4OqxpFHA.1968@.TK2MSFTNGP14.phx.gbl...
> Is there anyway without using a EXEC and a dynamic query (text string
> concatanated) to say used this column and compare it... like I want to do
> this
> 'WHERE ' + @.columnToSearch + ' like ''' + @.query + '%'')'
> just not as a concatanaged string... the @.columnToSearch is a user picked
> column in the application from a listing of possible choices like address,
> city, street, etc then they do a text search on it to find similar ones
> that start with what they typed into the applications text box. but right
> now i can only get it to work using a string build like above and executed
> by the EXEC command. I want to get rid of all dynamic SQL in my
> application though, anyone have any suggestions? thanks!
>
No comments:
Post a Comment