Hi
I use a SP to create a text file using FSO. I need to add extra spaces at the end of each line. When I look in the file, the extra spaces are not there.
For example:
SET @Data = 'ABC'
SET @Data = @Data + SPACE(5)
EXECUTE @RetCode = sp_OAMethod @FileHandle,'WRITELINE', NULL, @Data
it will be ABC with no extra spaces, but if I do that:
SET @Data = 'ABC'
SET @Data = @Data + SPACE(5) + '.'
EXECUTE @RetCode = sp_OAMethod @FileHandle,'WRITELINE', NULL, @Data
i will be ABC . So if the last character is not a space, it is fine.
Does anyone knows how to force the WRITELINE command to not drop the extra spaces?
Thanks!
Mal'chik
I use a SP to create a text file using FSO. I need to add extra spaces at the end of each line. When I look in the file, the extra spaces are not there.
For example:
SET @Data = 'ABC'
SET @Data = @Data + SPACE(5)
EXECUTE @RetCode = sp_OAMethod @FileHandle,'WRITELINE', NULL, @Data
it will be ABC with no extra spaces, but if I do that:
SET @Data = 'ABC'
SET @Data = @Data + SPACE(5) + '.'
EXECUTE @RetCode = sp_OAMethod @FileHandle,'WRITELINE', NULL, @Data
i will be ABC . So if the last character is not a space, it is fine.
Does anyone knows how to force the WRITELINE command to not drop the extra spaces?
Thanks!
Mal'chik