Is it possible with SQL Server 2008 to execute sql from a variabele in a user defined function? Or is using a stored procedure the only solution?

I have an sql statement saved in a variabele

```
@mySqlStatement = "select * from someTable"

```

I want to execute the above statement from within a user defined function, is that possible?