I'd like to insert a sql script into a table. I'm pretty sure this is more complicated than just wrapping the script in quotes and throwing it in an insert statement (scripts with quotes and more complicated escaping seem problematic for example)
So, how can I safely store arbitrary tsql in a SqlServer table?
I can use either sql or c# to encode the script if needed.