Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store procedure to increment one field
Message
General information
Forum:
Microsoft SQL Server
Category:
Stored procedures, Triggers, UDFs
Miscellaneous
Thread ID:
00800806
Message ID:
00800897
Views:
25
Thanks, I finally manage to have it working with this code inside the store procedure.

SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS OFF
GO

ALTER PROCEDURE dbo.DBCUpdate
(
@application char(20)
)
AS
SET NOCOUNT OFF;

UPDATE DBC SET session_start = session_start + 1 WHERE (application = @application);
SELECT session_start, application FROM DBC WHERE (application = @application)
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO


Carl,



>if no row is being affected, your WHERE clause is evaluating to FALSE. The value supplied for @application_1 is not being found in the [application] column.
>
>-Mike
>
>>Hi,
>>
>>I am trying to call a store procedure to increment one field
>>by one every time the store procedure is called, passing one parameter
>>to select the row I need to update.
>>
>>Here is some code I try directly in the store procedure, but without success,
>>
>>UPDATE [DBC].[dbo].[DBC]
>>
>>SET [session_start] = [session_start] + 1
>>
>>WHERE
>> ( [application] = @application_1 )
>>
>>
>>I try to run it directly from SQL server, but there is no row
>>affected, and the field is never incremented. But the syntax
>>verification is ok.
>>
>>Any Idea?
>>
>>Carl,
Carl Barbeau.
Analyst Designer office systems.
Carl Barbeau consultant Inc.
Previous
Reply
Map
View

Click here to load this message in the networking platform