开发者

Stored Procedure Hit Counter

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜