SQL Server Performance Forum – Threads Archive
Execute scripts saved in text column
If I save sql scripts in text column of a table, how can I execute them? Thanks, PeterHey, I really think this could have all been asked in one single thread. [<img src=’/community/emoticons/emotion-5.gif’ alt=’
![Wink ;) ;)](styles/default/xenforo/smilies/wink.png)
You need to copy it to variables(if it exceeds 8000 characters) and use dynamic SQL
Referhttp://www.sommarskog.se/dynamic_sql.html But why do you want to do this? Madhivanan Failing to plan is Planning to fail
Hi Frank, I thought about posting all these threads together but they are different questions in a way and it may be easier for others to find them later by having different threads. Hi Madhivanan, I think that Dynamic SQL may be the solution but I need to read the article first and then try it out.
Thanks,
Peter
]]>