Question Locked

sql function

0 helpful
2 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
how to use exec statement in udf function to excute a variable which given as select statement

2 replies

by tony hopkinson

Declare @MyQuery VarChar(500)
Select @MyQuery = "Select * From MyTable"
Execute (@MyQuery)

You have to put the parentheses in.

This discussion is closed to new replies.