Forum Replies Created

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

  • RE: Export to Excel inside a Stored Procedure

    --As an example:

    --first, i create the stored procedure...

    CREATE PROCEDURE [dbo.].[sp_DAILYSALES]

    @Cod_Forn int,

    @cod_Familia int

    AS

    BEGIN

    insert into openrowset(

    'Microsoft.Jet.OLEDB.4.0',

    'Excel 8.0;Database=C:\test.xls;',

    'SELECT cod_artigo,qtd,tpvp FROM [Sheet1$]')

    select distinct cod_artigo,

    sum(qtd) as qtd,

    sum(tpvp) as tpvp

    from Daily_Sales

    where (Cod_Forn=@Cod_Forn)

    and (Cod_Familia=@Cod_Familia)

    group by...

  • RE: Export to Excel inside a Stored Procedure

    Hi again,

    one of my questions is: can i use openrowset inside the stored procedure code?

    Nelson Pombinho

    Portugal

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