I have a little issue about logging files. I want to export this string called test, but i dont know why i cant do that.
I know that command_string should not have more than 8000 characters. I don't understand why this doesn't work. Can anyone help me with that?
DECLARE @LogFilePath varchar(max)
DECLARE @teste varchar(max) = 'columnsToSelect = [street],[locality],[postalCode1],[postalCode2],[isMainAddress]'
SET @LogFilePath = 'C:\Users\epascoal\Documents\Logs\Log_ImportToSQ.txt'
SET @cmd ='echo '+ @teste +' >>'+@LogFilePath
exec master..xp_cmdshell @cmd
This works with smaller strings.
Question:How can i write large strings into a logfile?
Thanks in advance.