txt file help

  • Hi all,

    Can someone help me please if it's possible at all:

    I have this simple select statement that outputs result into a text file using bcp command. Is there any way to have a header inside the text file like date and time file was created and total number of rows in the file?

    When issuing bcp command i am simply using "exec xx_storedprocedure"

    Thank you

  • You can write the header information to a different txt file then you can merge both txt file into one...

    I beleive merging is simple...

     

    MohammedU
    Microsoft SQL Server MVP

  • Thank you for reply, is this a special software i have to use for a merge?

  • I usually add a select statement for my header in front of the data select and union it .

     

    select header data

    union

    select query data from table 1

    Make sure the select for you header matches the output of the data select.


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

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