Copy SQL Table to existing csv file

  • Hi,

    I'm new to SQL and I need to create a SP to copy the contents of a TABLE and dump it to a csv or txt file.

    If the csv file is already there, then the data in my Table must be added and not overwritten.

    Does anyone has a sample of this functionality ?

  • look at the bcp utility in books on line. it has functionality you need.

    ...and your only reply is slàinte mhath

  • Thankyou. That was very usefull.

    Here is the Syntax I used:

    Running from a DOS prompt:

    bcp DbName.dbo.tablename out Filename.txt-Slocalhost\SQLEXPRESS -T -c

     

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply