TSQL _STORE PROCEDURE

  • Hi all,

    I have to write storeprocedure program should create a file.if not just show these results when we run the SP

    store_salesstore_stat.csv target

    StoreProduct SalesStoreAvg Sales TV Avg SalesDVD

    S1TV 456 S1 555 0

    S1TV654 S2597 213

    S2TV849

    S2TV345

    S2DVD213

    can anyone help on this...

  • Kind of feels like homework..

    CEWII

  • maheshkrishnas (2/21/2012)


    Hi all,

    I have to write storeprocedure program should create a file.if not just show these results when we run the SP

    store_salesstore_stat.csv target

    StoreProduct SalesStoreAvg Sales TV Avg SalesDVD

    S1TV 456 S1 555 0

    S1TV654 S2597 213

    S2TV849

    S2TV345

    S2DVD213

    can anyone help on this...

    Odd requirements, probably is homework.

    You can output query results to a file using sqlcmd (you can look up the syntax in books online).

    As to why you'd like to output results to screen in the alternative... why would you want to do this?

  • maheshkrishnas (2/21/2012)


    Hi all,

    I have to write storeprocedure program should create a file.if not just show these results when we run the SP

    store_salesstore_stat.csv target

    StoreProduct SalesStoreAvg Sales TV Avg SalesDVD

    S1TV 456 S1 555 0

    S1TV654 S2597 213

    S2TV849

    S2TV345

    S2DVD213

    can anyone help on this...

    There are many ways to do this:

    1. Use SQLCMD

    2. Use BCP Utility

    3. Make a SSIS package & export the data to file


    Sujeet Singh

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

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