Increment a column by 1 each time the SP is called

Hi folks, I’m trying to add 1 to the field Click each time this SP has run, not really sure how to implement this, code below;
USE [TyreSanner]
GO
/****** Object: StoredProcedure [dbo].[CountClicks] Script Date: 12/18/2014 11:29:06 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[CountClicks]
/******tbNumberOfClicks******/
@Clicks int
AS
SET NOCOUNT ON
BEGIN
UPDATE [TyreSanner].[dbo].[NumberOfClicks](Clicks)
Set Click = @Clicks + 1
END

Why do you pass a variable @Clicks to your SP? Just update the value in the table by +1 =>
UPDATE [dbo].[NumberOfClicks]
Set Clicks = Clicks + 1
BTW, you can already query the Count of SP calls from DMV:
Stored Procedure Execution Statistics => column "execution_count"
Olaf Helper
[ Blog] [ Xing] [ MVP]

Similar Messages

  • Adobe Form - Problem of data not refreshing each time the form is called

    Dear All,
    I have created a web dynpro component comprsing of two views.
    In the first view i am displaying an ALV which is bound to an internal table.
    After selecting one record i click on a button which calls the second view and in the second view
    i am displaying an adobe form.
    i have provided a native wd submit button  which again calls the first view.
    The first time when i select the record it works fine and shows me correct data.
    but second time onwards it shows me the data one previous to the current row selected.
    Kindly give your valuable suggestions>
    Regards,
    Niti
    Moderator message: sorry wrong forum, please have a look in the forum for "Adobe Interactive Forms".
    Edited by: Thomas Zloch on May 9, 2011 5:59 PM

    Instead of using in the java code.
    For the html page and in jsp pages use the following code
    1) Coding Method:
    <META HTTP-EQUIV="PRAGMA" CONTENT="NO-CACHE">
    2) Browser setting:
    You can adjust the space to store the temporay files. On the Tools menu in Internet Explorer, click Internet Options, On the General tab, click Settings. you can select the newer version radio button also, adjust the "amount of disk space to use" slider towards the left side(equivalent to disable the cache)..
    cheers
    -balaji

  • HT204053 We both use the same iPad my father and I as of today, because I am using it too from now on, but each time the ID & Password pops up it ask for his, how can I access mine, so it's my account and financials being used. Thanks to any of those gift

    We both use the same iPad my father and I as of today, as is letting me use it too from now on (sweet! ), I do not want to make a mistake and accidently use my father's ID & passwords (dohh ), but each time the ID & Password pops up it ask for his (???), how can I access mine, so it's my account and financials being used. Thanks to any of those gifted with this knowlegde... AMAKANGAROO

    In order to reliably save the info and be able to restore at a later date, you would need to use his AppleID.
    Switch to it on iTunes, back the iPad up and confirm the backup exists (Preferences / Devices), then switch to yours, wipe the iPad and start afresh. Will also wipe his apps, as they are tied to the AppleID as well.

  • How can I stop a sound from looping so it plays only once each time the up key is pressed?

    Hi there here is my code, the basis is it is playing a mp3 from my library.
    Basically as the topic suggests I only want the sound to play once each time the UP arrow key is pressed. At the moment when you hold the up arrow down the sound keeps triggering and looping and gets really loud and noisy.
    Here is my code for my game:
    package com.chasegame.components
              import flash.display.MovieClip;
              import flash.display.Stage;
              import flash.events.Event;
              import com.tech.utils.KeyObject;
              import flash.ui.Keyboard;
              import flash.media.Sound;
              import flash.media.SoundChannel;
              public class SpaceShip extends MovieClip
                        private var key:KeyObject;
                        private var speed:Number = 0.3;
                        private var rotateSpeed:Number = 5;
                        private var vx:Number = 0;
                        private var vy:Number = 0;
                        private var friction:Number = 0.95;
                        private var shipSound:roar = new roar();
                        private var shipSoundChannel:SoundChannel = new SoundChannel();
                        public function SpaceShip () : void
                                            key = new KeyObject(stage);
                                            addEventListener(Event.ENTER_FRAME, loop, false, 0, true);
                        public function loop(e:Event) : void
                                            if (key.isDown(Keyboard.UP))
                                                           vy += Math.sin(degreesToRadians(rotation)) * speed;
                                                           vx += Math.cos(degreesToRadians(rotation)) * speed;
                                                           shipSoundChannel = shipSound.play();
                             else
                                                           vy *= friction;
                                                           vx *= friction;
                                  if (key.isDown(Keyboard.RIGHT))
                                            rotation += rotateSpeed;
                                  else if (key.isDown(Keyboard.LEFT))
                                            rotation -= rotateSpeed;
                                  y += vy;
                                  x += vx;
                                  if (x > stage.stageWidth)
                                            x = 0;
                                  else if (x < 0)
                                            x = stage.stageWidth;
                                  if (y > stage.stageHeight)
                                            y = 0;
                                  else if (y < 0)
                                            y = stage.stageHeight;
                        public function degreesToRadians(degrees:Number) : Number
                                  return degrees * Math.PI / 180;

    If you want the sound to only play once when the key is pressed then you don't want to have it in the ENTER_FRAME event handler like you have it.  It is starting new sounds at the frame rate of your file the way you have it now.
    Try having an event listener dedicated to a KeyboardEvent.KEY_DOWN event where you detect when the UP key gets pressed and use that to trigger playing the sound.

  • How to create a unique file name each time the form is saved?

    I've got a form with several data items. When the user saves the form, it saves it as an .xml file. So far so good. But then I want the user to be able to start over and put in a new data set. I used the reset form button and this clears out the old data. But when the user goes to save the form for the second set of data, the default name of the .xml file is the same as the last record set. How do I get LCD to create a unique data name each time the form is saved? I know that the user can enter a new name, but I do not want them to have to think that much.
    Alternatively, is there a way that a user can enter several forms of data and save all of the data in one XML file that my PDF can scroll through or that I can import into excel and keep all of the data sets separate?

    Thanks Paul for the post. It sounds like this program is simply not designed for one user to keypunch a batch of forms. It would appear to limit the program's use to users who only need to key in one record/form. While a good solution for multiple users who need to enter just one set of data, the limitation would explain why this program is not widely used.

  • How do you set a defalut theme(in this case, the theme is HiFi) so each time the computer starts, you do not to have to constantly change it??

    How do you set a default theme(in this case, the theme is HiFi) so each time the computer starts, you do not to have to constantly change it??

    for some reason the function never get's called. I have this
    MyComboBox.dropdown.addEventListener(ToolTipEvent.TOOL_TIP_SHOW,
    myListener);
    and ive tried this:
    MyComboBox.addEventListener(ToolTipEvent.TOOL_TIP_SHOW,
    myListener);
    private function myListener (e:ToolTipEvent) : void {
    trace("e: " + e.target);
    trace("e: " + e.toolTip);
    Any more ideas?

  • Jafa log file is suplicated each time the process is run

    Hi all,
    I am trying to create a file logger,,Following is part of my coding.
    Now I can see the log file being created. However my problem is that every time I run the process the log is appended to the test.log file correctly. But the problem is that it also create test.log.1, test.log.2.. etc files each time the process is run. It will be great if anyone advise me how to eleminate these extra files being generated each time. I need just one log file to be genereted and all the logs to be appended to it.
    boolean append = true;
    FileHandler handler = new FileHandler(test.log);
    SimpleFormatter simpleFormatter = new SimpleFormatter();
    handler.setFormatter(simpleFormatter);
    logger.addHandler(handler);Thanks in adavance

    Are you saying that it is creating new logs AND appending to the other one? That doesn't seem quite right.

  • When using iPhone with Ford automobiles' Sync, the connection drops each time the ignition is shut off. In order to restore, the bluetooth must be turned off on the iphone, then restarted. Any suggestions?

    When using iPhone with Ford Automobiles' SYNC, the connection drops each time the ignition is shut off. To restore, you must turn off the bluetooth on iPhone, then restart each time. Any suggestions?

    There is an update avaialbe for Ford systems to correct bluetooth problems. You need to update your system.

  • HT5312 I forgot the answers to my securtiy questions so I had apple send me an email to reset them, however I have not recieved the email.  I've tried this many times and each time the email was never sent.

    I forgot the answers to my securtiy questions so I had apple send me an email to reset them, however I have not recieved the email.  I've tried this many times and each time the email was never sent

    If you aren't receiving the email to your rescue email account (and you've checked the spam folder on it as well as the inbox) then you will need to contact iTunes Support / Apple in your country to get the questions reset.
    Contacting Apple about account security : http://support.apple.com/kb/HT5699

  • HT201210 hi,am trying to restore my ipod but i am getting this message each time:the ipod could not be restored-an unknown error occured,what should i do?

    hi,am trying to restore my ipod but i am getting this message each time:the ipod could not be restored-an unknown error occured,what should i do?

    Was the complete wording of the error message? Usually an error number or other information is also provided

  • Best Lyrics cannot be permanently removed. It must have installed a hidden file that creates the add on each time the computer is booted.

    I inadvertently allowed the Best Lyrics add on to be installed for Firefox. It has annoying adds and sometimes links to malicious software. It can be disabled or removed from a session and become non functional after a Firefox restart but each time the computer is booted up it appears again. I assume there must be a file hidden somewhere that re-installs the add on each time the computer is started up. Does any one know how to remove this permanently?

    Thanks for the tip. It rurns out that the Bestlyrics was actually added as a program and I was able to get rid of it by uninstalling it from the control panel. (Should of thought of this before). I downloaded and ran Malwarebytes and it did find a couple of other PUP items for adware that I deleted. Thanks for the tip.

  • HT4972 I attempted to install the iOS 5 software onto my iPhone 4 several times a few months ago. Each time the download timed out at about 3.75 hours. Any suggestions on how to complete the update?

    I attempted to install the iOS 5 software onto my iPhone 4 several times a few months ago. Each time the download timed out at about 3.75 hours. Any suggestions on how to complete the update?

    See... Updating to iOS 5
    http://support.apple.com/kb/HT4972
    If you are using windows...
    Temporarily disable your firewall and antivirus software and try again...
    See here for Connection Issues
    http://support.apple.com/kb/TS1379
    From Here
    http://www.apple.com/support/itunes/troubleshooting/

  • I burnt CDs thru Finder and IPhoto. Each time the titles failed to transfer. Why?

    I burnt CDs thru Finder and IPhoto. Each time the titles failed to transfer. Why?

    Where are you looking for the Titles? You're not confusing titles - which are an entry in the Exif metadata of the file - with Filename?
    Regards
    TD

  • My computer struggles to log in. I have to shut it down each time the computer has been shut and asleep for a few hours. The first day it happened my desktop photo was reset.

    My computer struggles to log in. I have to shut it down each time the computer has been shut and asleep for a few hours. The first day it happened my desktop photo was reset.

    Have you tried a PRAM reset?
    http://support.apple.com/kb/HT1379
    Ciao.

  • TS3253 My Iphone 4S version 6.1.1 will not automatically connect to my bluetooth in my car.  It is paired and registered with the car bluetooth, but I have to select the device each time the car is started.

    My IPhone 4S with version 6.1.1 will not stay connected to the bluetooth in my 2012 Subaru Outback.  The phone is paired and registered with the bluetooth in the car, but each time the ignition is turned off the phone loses connection with the bluetooth and I have to select the device again.

    You posted in the iPad forum instead of the iPhone forum. To get answers to your question, next time post in the proper forum. See https://discussions.apple.com/index.jspa  I'll request that Apple relocate your post.
     Cheers, Tom

Maybe you are looking for

  • My old phone broke and I am having trouble figuring out how to restore my contacts on my "new" phone (LG ENV2 Black)...

    My old phone broke and I am having trouble figuring out how to restore my contacts on my "new" phone (LG ENV2 Black).  Apparently the phone is so old that I am unable to install Backup Assistant on it, which sucks.  I have all my old contacts saved o

  • Need To Add 2nd Hard Drive

    Hello All, I need to add a second drive to my powermac g5. I have the stock 80gb drive in there and want to get the largest, fastest drive the g5 will accept for the second slot. Does anyone know what the largest drive size i can put in there is? 500

  • Using Skype with my Mini

    I downloaded Skype and was able to instant message. However, I can't make a direct connection when sending files. What ports should I open up, UDP and TCP/IP on my Mac. I'm using the built-in firewall, and I also have an AirPort Extreme base station.

  • Reset a pricing condition type value when generating billing document

    Hi experts,    I have a delivery-related billing type. In sales order, there is a pricing condition type Z001, with value = 100, I would like to reset it to zero when generating billing document. Is there any configuration or user exits can do this?

  • 404 page not found error after upgrade to 4.0 from 3.x

    We developed this application in 1.6 and a couple years ago upgraded to 3.2. We've just upgraded the Production version to 4.0.0 (that's what was on the Dev box). I understand that the template we used when developing it is now obsolete and I added s