BCP vers CSV caractère spécial
Bonjour,
j'utilise l'utiliaire BCP pour exporter des données de mes tables vers un fichier csv. Par contre, au lieu que mon fichier soit séparé par des ';' il est séparé par
des carrés.
Comment pourrais-je faire pour avoir le bon caractère?
Ci-dessous la procédure que j'utilise
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| create procedure toto @ID nvarchar(128)
AS
begin
--Ecrit le contenu d'une table passée en paramètre dans un fichier texte
declare
@FileName varchar(50),
@bcpCommand varchar(2000)
SET @FileName = REPLACE('c:\res_' + convert(char(8), getdate(),1)+'.csv','/','-')
SET @bcpCommand = 'bcp "SELECT * FROM Produit, Details WHERE Produit.ID ="'+ @ID + '" and Produit.IDElem = Details.IDElem" queryout "'
SET @bcpCommand = @bcpCommand + @FileName + '" -U jorj -P "jorj" -c'
end
--PRINT @bcpCommand
exec master..xp_cmdshell @bcpCommand |
Merci pour votre aide