Etape 1 : Installer un IDE SQL : Installer Microsoft SQL Server Management Studio (environ 500 Mo) https://learn.microsoft.com/en-us/sql/ssms/download-sql-server-management-studio-ssms?view=sql-server-ver16#download-ssms Connecter avec l'authentification Windows Paramétrage : - Par défault : Results to Grip - Click droit sur les résultats de la query et "Save result as..." en CSV Etape 2 : sqlcmd utility Installer sqlcmd utility Lancer le prompt DOS > sqlcmd -S erp-carto → Les caractères 1> vont apparaitre Tester : 1> SELECT CLI.TIERS FROM CARTOFLEX.dbo.CLI CLI WHERE CLI.TIERS = 'C0000002' 2> GO Etape 3 : Créer un fichier avec les résultats d'une query https://learnsql.com/blog/export-csv-file-ms-sql-server/ https://learn.microsoft.com/en-us/sql/tools/sqlcmd/sqlcmd-utility?view=sql-server-ver16#syntax Sous DOS : > sqlcmd -S erp-carto -Q "SELECT CLI.TIERS FROM CARTOFLEX.dbo.CLI CLI WHERE CLI.TIERS = 'C0000002';" -o "C:\tmp\tmp.csv" -W -w 1024 -s ";" -h-1 sqlcmd is the command name. -S erp-carto specifies the server name. -Q "SELECT CLI.TIERS FROM CARTOFLEX.dbo.CLI CLI WHERE CLI.TIERS = 'C0000002';" is the query that fetches data to be exported. -o "C:\tmp\tmp.csv" defines the file that stores the exported data. -W removes the trailing white spaces you see in the command line tool output after each value. -w 1024 defines the length of the line in the CSV file. -s ";" defines the separator for the column values; here, a comma. -h-1 removes the header. Annexes : Command : - EXIT - QUIT