Re: Returning Value to Web App via Stored Procedure



Thank You Hari,

The SP logic was correct. I made the change you suggested for the name.

The reason it was counting two times was because I had my VB messed up on
the ASP.NET application.

I had cmd.ExecuteNonQuery() twice.

Thank You.

"Hari Prasad" wrote:

Hello,

A small suggestion. Please create the user defined stored procedures with a
name other thyan SP. SQL Server witll treat the SP's start with name SP as
system proc and scan system database.
So try to use a name like USP_.

Regarding the procedure, I am sure that inncrement will happen by 1 based on
the below logic.

Thanks
Hari

"IronSights" <IronSights@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:C426E7D0-49E7-44D5-AE97-DE426106D95B@xxxxxxxxxxxxxxxx
I am trying to run an update stored procedure that will add 1 revision to
the
rev field and return the Value back to my Application. My number is
incrementing by 2 and not 1.

Here is my Stored Procedure

CREATE PROCEDURE dbo.sp_Update_file

@kbid big,
@filename nvarchar(50),
@rev big OUTPUT,
@moddate datetime,
@owner nvarchar(50),
@author nvarchar(50)

As

UPDATE KBFile

SET
rev = rev + 1,
filename = @filename,
moddate = @moddate,
owner = @owner,
author = @author,
@rev = (Select rev from kbfile where kbid = @kbid)
WHERE kbid = @kbID
GO




.



Relevant Pages

  • Re: Returning Value to Web App via Stored Procedure
    ... Please create the user defined stored procedures with a ... @moddate datetime, ... owner = @owner, ... WHERE kbid = @kbID ...
    (microsoft.public.sqlserver.mseq)
  • Re: Pass-thru SQL performance vs Stored Proc
    ... >> you have a lot of parms building a large procedure is a possible ... >> in stored procedures for all of the good reasons (performance, security, ... SQL Server MVP ... >> So my suggestion is that if you have a relative few number of parameters ...
    (microsoft.public.sqlserver.programming)
  • Re: Going to a specific page?
    ... Your suggestion is ideal. ... your suggestion - defining a rowfilter on the dataview prior to binding ... already screwed the client the few $s left are being applied to meeting ... stored procedures I'll add an option to constrain the search by alpha ...
    (microsoft.public.dotnet.framework.aspnet.datagridcontrol)
  • Re: Dynamic SQL
    ... Stored procedures is a good suggestion i guess. ... Doesn't stored procedures have to deal with SQL commands? ... Doesn't parameterised updates or selections generate SQL commands? ... There are incorrect characters in that line. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Insert SP Problem
    ... I tried you suggestion ... > calling the individual insert and update stored procedures. ... > SQL: ...
    (microsoft.public.sqlserver.programming)