Currently I have been tasked to modify a super old stored procedure that represents an email output in our SQL 2000 instance. With correcting a few syntax issues I wanted the original string format to be more presentable in the email. Because the fields "machine" and "Part #" have a variance of the fields data length thus the fields shift and the columns do not line up entirely. What I have been attempting is to set each field present in my SQL code to hard set values of say 15 characters that way the format of each field presented does not change/shift and looks straight to the end user. Now I have tried a few suggestions online and could not find a method to set each field. Any ideas?
INSERT INTO ##prod_performance_txt_out2
SELECT LEFT(machine + ' ', 9)
+ LEFT(part_no + ' ', 30)
+ LEFT(CONVERT(varchar(7), ordered) + ' ', 7)
+ LEFT(CONVERT(varchar(7), picked) + ' ', 7)
+ LEFT(CONVERT(varchar(7), allocated) + ' ', 7)
+ LEFT(CONVERT(varchar(7), in_stock) + ' ', 7)
+ LEFT(CONVERT(varchar(7), sh_bin_qty) + ' ', 7)
+ LEFT(CONVERT(varchar(7), short) + ' ', 7)
+ min_bin
FROM #tempsummary2 WHERE resource = @resource AND short > 0