Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How to Concatenate Strings That Have Trailing Spaces?

0
Posted

How to Concatenate Strings That Have Trailing Spaces?

0

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

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123