wvandenberg
Technical User
I have a stored procedure that builds a dynamic query. I would like to prefix the first column header with a pound sign (#) but the following does not include the # in the final SQL string. Please note that the first colomn is intended to be filled with an empty string.
Current select portion of the dynamic query:
Current resulting SQL
Resulting column headers:
Location_Group Location facility_code Easting Northing Zone Client
Desired column headers
#Location_Group Location facility_code Easting Northing Zone Client
Thanks in anticipation,
Wendy
Current select portion of the dynamic query:
Code:
set @select = 'SELECT '''' as [#Location_Group], l.sys_loc_code as Location, f.facility_code
, c.x_coord, c.y_coord, REPLACE(LEFT(RIGHT(c.coord_type_code,5),2),''_'',''''), f.client '
Current resulting SQL
Code:
SELECT '' as [#Location_Group], l.sys_loc_code as Location, f.facility_code
, c.x_coord, c.y_coord, REPLACE(LEFT(RIGHT(c.coord_type_code,5),2),'_',''), f.client FROM cte
INNER JOIN ...
Resulting column headers:
Location_Group Location facility_code Easting Northing Zone Client
Desired column headers
#Location_Group Location facility_code Easting Northing Zone Client
Thanks in anticipation,
Wendy