I wrote a tsql procedure which inserts a string into a text file which means it requires all variables be converted to a string. Instead of using a case by case statement, is there an easier to do this which encompasses all cases and forces whatever type to a string type?
thanks in advance
All-caps is literal text, lower-case is something into which you should interpolate a value:
You can optionally specify a length.
Unfortunately, it's a bit harder with datetimes, if you want to format it in any way that's different from the default representation.
My info came from the MSDN site. I think you'll have to read that site, and others, carefully and play around with it a bit, but hopefully the
CAST
function will be a good start.Good luck!