How to Concatenate Strings That Have Trailing Spaces?
I am trying to export data from a SQLServer database into a text file using a stored procedure. I want to be able to read it and debug it easily; therefore, I want all the columns to indent nicely. This means I need to append trailing spaces to a text string (such as “Test1 “) or append leading space in front of a text string that contains a number (such as ” 12.00″). Now, the stored procedure works fine when I run it in Query Analyzer. But it doesn’t work correctly when I run it using ISQL – All the columns are not indented. I am wondering why it doesn’t work in ISQL. This is what I want, and this is also what I get when I run the stored procedure using Query Analyzer: Test1 , 2,Test1.txt , 1.00, 1.00 Test22 , 2,Test22.txt , , Test333 , 2,Test333.txt , 30.00, 30.00 This is what I get if I run the stored procedure using ISQL (isql -S myserver -E -w 556 -h-1 -n -d mydb -Q “exec MyTest”): Test1, 2,Test1.txt, 1.00, 1.00 Test22, 2,Test22.txt, , Test333, 2,Test333.txt, 30.00, 30.00 You can