OUTPUT OF A QUERY/STORED PROCEDURE INTO A EXCEL FILE

  • Hi,

    THIS IS THE DATA IN MY TABLE

    ENO      ENAME

    1           NAME1

    2           NAME2

    3           NAME3

    4          NAME4

    I WANT TO WRITE A STORED PROCEDURE

    THIS WILL BE IN THE LOOP

    set @I=1

    WHILE (I<5)

    SELECT * FROM EMP WHERE ENO=@I

    set @I=@I+1

    LOOP

    THE ABOVE STATEMEMNT WILL EXECUTE 4 TIMES ,EACH TIME IT WILL GIVE ONE RECORD,

    EACH RECORD I WANT TO STORE IN AN EXCEL FILE.

    IN THE ABVOE I WANT TO STORE 4 RECORDS IN 4 EXCELFILES WITH DIFFERENT NAME.

    Is it possible in sql server?

     

  • Just recently there was an article posted titled "Using DTS to Generate and Email Excel Reports" that might be useful in solving your problem.  This solution used DTS and could easily be adapted to your needs.

  • THAT ARTICLE WILL BE USEFUL  ONLY FOR ONE EXCEL FILE BUT I WANT TO CREATE MULTIPLE EXCEL FILE.

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

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