English 中文(简体)
储存程序 日报
原标题:Stored Procedure Hit Counter

我在2008年5月管理数据库表中有一个表,有3栏。

ID
ToolID
Count

某人能否给我一个文字,以建立一个接受半工具箱并提高其价值1的储存程序?

我的所有努力都失败了。

最佳回答

审判:

CREATE PROCEDURE IncrementToolCount
(
   @ToolID  int
)
AS
SET NOCOUNT ON

UPDATE Tools_Usage SET [Count]=ISNULL([Count],0)+1 WHERE ToolID=@ToolID

GO
问题回答

暂无回答




相关问题
LINQ to SQL optional Column

I need a functionality to have optional columns in a LINQ to SQL definition. So that LINQ to SQL normally ignores this column within selects and updates etc. But if a select contains a value for this ...

Optional where clause / parameter in a SQL 2008 stored proc?

I m writing some code that updates a table. Depending on what the user wants to do, it either updates a large set of records, or a smaller one. The delineating factor is a group ID. The user can ...

How to control access to a Stored Procedure in SQL Server?

I want to be able to have a Stored Procedure that can only be used from a particular page, without having to create a permissions / role for a user, when it is just a single stored procedure I want ...

Selecting records during recursive stored procedure

I ve got a content management system that contains a hierarchical structure of categories, with sub-categories subject to different ordering options at each level. Currently, that s retrieved by a (...

热门标签