Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
JacobPressures
Posting Yak Master
112 Posts |
Posted - 2013-01-04 : 11:54:10
|
Is it possible to execute a dynamically created SQL statement that is stored in a variable in a regular SQL statement? (I'm considering creating a function but I thought I'd find out just in case.)I have a tedious Statement that would be better created dynamically rather than manually. I'd like to use it in as a subquery perhaps.Suppose I had a statement such as (just a simple example i suppose)SET @SQLstr = 'SELECT UPPER(FName) FROM Person'Of course something that simple i could just write out but i assume any type of complex string operation would be same regardless.Thanks |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
|
|
|