how to bulk insert a table to csv file


  • how to bulk insert a stored procedure to csv file.. from inside isql to produce a csv file
    • Moved by Gert Drapers Saturday, July 20, 2013 4:47 PM Tsql question not a tools one
    Saturday, July 20, 2013 3:36 PM


  • Hi abe_icm,

    We can use the following commands to create a stored procedure which can output data to a CSV file.

    create proc TestOut 
    exec xp_cmdshell 'bcp AdventureWorks2008R2.Sales.Currency out D:\data\Currency.csv -T -c'  
    -- To execute stored procedure TestOut
    exec TestOut
    For more detail information, you can refer to the following link:

    xp_cmdshell (Transact-SQL)

    bcp Utility

    Allen Li
    TechNet Community Support

    Tuesday, July 23, 2013 2:23 AM

All replies