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?
fnamewithout an@in front is not a valid parameter.