I have to log some param values to a log file (SQL Server 2005)
Is there an universal .ToString() method in SQL that could convert any kind of object to string in order to visualize a object value?
by eg. if I use STR(@param) it expects that @param be an float or integer value. and it fails when the @param is a varchar…
You should be able to convert any parameter to a string using
CONVERT()orCAST():Whether the conversion is meaningful is another thing.