a simple question

  • hi

    i wrote an store procedure:

    ALTER PROCEDURE [dbo].[DownloadCount_SP]

    @FileCodesql int

    AS BEGIN

    update [File]

    set DownloadCount=DownloadCount+1

    Where FileCode = @FileCodesql

    END

    Now i want to have this record.

    i mean i want this store procedure give me the above record

    could you please help me?

  • select DownloadCount

    from File

    Where FileCode = @FileCodesql

  • ooooooooo no

    i want to have store procedure that do this:

    ALTER PROCEDURE [dbo].[DownloadCount_SP]

    @FileCodesql int

    AS BEGIN

    update [File]

    set DownloadCount=DownloadCount+1

    Where FileCode = @FileCodesql

    END

    and this store proceduure in addition give me this updated record,

    in above only this store procedure updates on field

    and aquestion could we have update and select in one store procedure?

  • nazaninahmady_sh (10/28/2009)


    ooooooooo no

    i want to have store procedure that do this:

    ALTER PROCEDURE [dbo].[DownloadCount_SP]

    @FileCodesql int

    AS BEGIN

    update [File]

    set DownloadCount=DownloadCount+1

    Where FileCode = @FileCodesql

    END

    and this store proceduure in addition give me this updated record,

    in above only this store procedure updates on field

    and aquestion could we have update and select in one store procedure?

    You could have a select as well if you want. I think you need to work out exactly what you are trying to achieve. you can use the output clause as part of the update if you want to view the change that you made.

    --------------------------------------------------------------------------------------
    [highlight]Recommended Articles on How to help us help you and[/highlight]
    [highlight]solve commonly asked questions[/highlight]

    Forum Etiquette: How to post data/code on a forum to get the best help by Jeff Moden[/url]
    Managing Transaction Logs by Gail Shaw[/url]
    How to post Performance problems by Gail Shaw[/url]
    Help, my database is corrupt. Now what? by Gail Shaw[/url]

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

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