开发者

Stored Procedure Hit Counter

开发者 https://www.devze.com 2022-12-30 13:20 出处:网络
I have a table with 3 column\'s in a table on a MS SQL 2008 Database ID ToolID Count Can someone toss me a script that will create a stored procedure that accepts the param ToolID and increases its

I have a table with 3 column's in a table on a MS SQL 2008 Database

ID
ToolID
Count

Can someone toss me a script that will create a stored procedure that accepts the param ToolID and increases its value by 1?

A开发者_StackOverflowll of my efforts have failed.


try:

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

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

GO
0

精彩评论

暂无评论...
验证码 换一张
取 消