Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing a query held in varchar variable

Status
Not open for further replies.

rodeomount

Programmer
Sep 25, 2007
50
US


I have a variable called @FilterCmd wher I am creating a query based on many different factors. The query is a select query. I tried running the query like so:

exec @FilterCmd

But I get an error. How can execute this?
 
Weird, but you gotta use parenthesis.

exec [!]([/!]@FilterCmd[!])[/!]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top