How to concatenate a stored procedure parameter inside a SQL Server string query?

Viewed 4046

I am trying to concatenate a parameter of my stored procedure inside a query but it always keeps showing an error . This my query:

EXEC xp_cmdshell 'bcp "SELECT matriculeEmployeur,
                              cleEmployeur,
                              codeDexp,
                              trimestre,
                              annee,
                              page,
                              ligne,
                              matriculeAssure,
                              cleAssure,
                              CONCAT(CONCAT(nom,nomPere,prenom),space(60-LEN(CONCAT(nom,nomPere,prenom)))),
                              carteIdentity,
                              salaire 
                              FROM ##myTempo" queryout "FILEPATH"' +fname+ '-c -T'.

The error is shown on the first concatenation symbol [the first plus sign]. What error did I make here?

1 Answers
Related