I am using pivot function in SQL Server.
My select is built dynamically and uses pivot function.
Since the are a lot of guid in the values I use “as” and assign it a name – (it would be easy to maintain it if I give the columns that are generated from attribute values new names.)
But the values include ., space, -, + and other illegal characters. Is there a way to contain those characters?
Here is a simple example :
string s =
" select MyColumn as My Attribute
from MyTable My Table "
where My Attribute and My Table are generated names
Enclose those names in square brackets: