I want to write a text column (a column of datatype text) to a variable declared in t-sql. How do I accomplish that?
I know if it is varchar, we can declare a variable of type varchar with a max width of 255. But how do I do the same for text datatype? What is the maximum?

I need to write the columns to a flat-file.

Any help appreciated.