How to delete an update field automatically

Dear all,
I have a a local SQL server 2012 express version where I have a dedicated table which stored local ORDERS.
In this table named "SALESORDER" I have a Boolean field called Transfert. When an order is place, that field is set to FALSE.
Then I have an running NT service which pool every 15 s that SALESORDER table for new records where Transfert=FALSE.
Then for each records found, they are send to the cloud. Once a records get successfully send to the cloud, I need to set the Transfert field to TRUE.
Then what I need to do is having a trigger that when a record gets its Transfer field = True, I need to delete that record from local table because it has been successfully proceed.
How to do that efficiently ?
INFO : Just a remark that I am storing orders locally in order to delegate the sending cloud task to a different process for performance reason

Try below
Create table SALESORDER
orderid int,
Transfert varchar(10) default ('FALSE')
GO
IF OBJECT_ID ('SALESORDER_upd_deleteTransfert','TR') IS NOT NULL
DROP TRIGGER SALESORDER_upd_deleteTransfert;
GO
CREATE TRIGGER SALESORDER_upd_deleteTransfert ON SALESORDER
AFTER UPDATE
AS
IF EXISTS (SELECT *
FROM SALESORDER AS SO
JOIN inserted AS i
ON SO.orderid = i.orderid
WHERE i.Transfert = 'TRUE'
BEGIN
delete so
FROM SALESORDER AS SO
JOIN inserted AS i
ON SO.orderid = i.orderid
WHERE i.Transfert = 'TRUE'
END;
GO
INSERT INTO SALESORDER(orderid)
select 1 union all
select 2 union all
select 3
select * From SALESORDER
orderid Transfert
1 FALSE
2 FALSE
3 FALSE
update SALESORDER set Transfert= 'True' where orderid = 2
select * From SALESORDER
orderid Transfert
1 FALSE
3 FALSE
you can create trigger for this case, but i would recommend to delete the records while you are marking the record processed, or move to another table
Thanks
Saravana Kumar C

Similar Messages

  • How to DELETE a TARGET FIELD in a structure of LSMW for GL accts creation?

    Hi Experts,
    I developed a LSMW for GL accts creation.
    I used DIRECT INPUT method, below are the details,
    Prog. - RFBISA00
    Object- 0010
    Method - 0002
    Prog. type is "B" - Batch input.
    Issue: we r getting ther BSKX structure, its for GL Creation.
    But, here we r getting the field STYPE in this strucure, its making issue for us.(we dont hv any SOURCE STRUCURE for it, so, nothing is assigning for it?
    Pls. let me know that,
    How to DELETE this STYPE field in this LSMW under field mapping radio button?
    thanq
    Edited by: SAP ABAPer on Nov 18, 2008 3:34 PM

    Well Carlos, that would destroy the process, as STYPE is a necessary, technical field. Please care and read previous replies before suggesting potentially dangerous action.
    Thomas

  • How to delete or Update the data in the MEAN table

    Hello Gurus,
    I would like to delete or update the data in the MEAN table...how to do it.
    Precisely I would like to change the status of Main EAN Indicator (field HPEAN).
    Kindly let me know ??
    Rehards
    Senthilll

    programmatically, you may use [BAPI_MATERIAL_SAVEDATA|https://www.sdn.sap.com/irj/scn/advancedsearch?query=bapi_material_savedata&cat=sdn_all] [EAN|https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=bapi_material_savedata+ean&adv=false&sortby=cm_rnd_rankvalue]
    Regards,
    Raymond

  • How to delete custom AET fields in CRM 7.0 Web UI

    Hello gurus,
    When I want to delete a custom AET field created by a mistake or for exercising purposes only, the UI Config tool markes it for deletion by changing a status to "Marked for Deletion" (a garbage bucket icon). My question is how to proceed further, i.e. eliminate the field completely. Do I need to manually delete the fields from the "Append" structures in the corresponding CRMS_xxxx Attribute structure, or do something like this?

    Hi,
    note: please do not delete the field manually from SAP GUI.
    AET is able to create and delete custom field. The deletion process happens always in 2 steps.
    1. you select which field you want to delete and press on delete icon. This will mark the field to be deleted.
        As long, you do not "Save and Generate". This deletion mark will not be persisted and the complete deletion of the field will not be executed. Having this mechanism, you are always able to cancel the deletion.
    2. If you really want to delete the field. Press on "Save and Generate". "Save" will persist the deletion mark for the field.
        And "Generate" will do the "Delete" generation.
    Please don't forget to remove the field from the UI configuration, when you configured the field in any UI Config before.
    Regards,
    Steve

  • I am using Iphone 4... how to delete the updates in the app store icon? I dont want my updates to be there anymore.. pls help me with this.. the history in updates under the app store... thanks.

    I'm using Iphone 4. how to delete the stuff in UPDATES section from the app store icon pls??????

    The only way to do that is to delete the apps on your phone or update the apps.

  • How to delete a custom field created in Address Book template?

    It is possible to create a new custom field name in any of the pop-up field categories in the preferences template for Address Book.
    But, once created, there does not seem to be a way to delete or edit the newly created custom field name. That doesn't make sense.
    Tell me that I am wrong, and then tell me how to delete or edit a custom field name. Thanks!!

    Thanks Pascal, I can change the viewed template field areas as you have described. My problem was with modification of the pop-up list entries: adding, deleting, and renaming user created custom field entries. I have since figured out how Address Book allows these functions; unfortunately, that specific information is not present in the Address Book help file.

  • Dynamics AX 2012 R3: How to populate Payment Reference field automatically?

    Hi guys
    I am trying to configure AX 2012 (R3) to populate the Payment Reference field automatically when processing payments through a payment journal. I have looked for a number sequence in the AR/AP parameters but so far with no luck.
    Please advice
    André

    Unfortunately your post is off topic here, in the TechNet Site Feedback forum, because it is not Feedback about the TechNet Website or Subscription.  This is only one forum among the many that are on the TechNet Discussion Forums, and given
    your post, you likely chose the wrong forum.  This is a standard response I’ve written up in advance to help many people (thousands, really.) who post their question in this forum in error, but please don’t ignore it.  The links I share below I’ve
    collected to help you get right where you need to go with your issue.
    For technical issues with Microsoft products that you would run into as an
    end user of those products, one great source of info and help is
    http://answers.microsoft.com, which has sections for Windows, Hotmail, Office, IE, and other products. Office related forums are also here:
    http://office.microsoft.com/en-us/support/contact-us-FX103894077.aspx
    For Technical issues with Microsoft products that you might have as an
    IT professional (like technical installation issues, or other IT issues), you should head to the TechNet Discussion forums at
    http://social.technet.microsoft.com/forums/en-us, and search for your product name.
    For issues with products you might have as a Developer (like how to talk to APIs, what version of software do what, or other developer issues), you should head to the MSDN discussion forums at
    http://social.msdn.microsoft.com/forums/en-us, and search for your product or issue.
    If you’re asking a question particularly about one of the Microsoft Dynamics products, a great place to start is here:
    http://community.dynamics.com/
    If you really think your issue is related to the subscription or the TechNet Website, and I screwed up, I apologize!  Please repost your question to the discussion forum and include much more detail about your problem, that could include screenshots
    of the issue (do not include subscription information or product keys in your screenshots!), and/or links to the problem you’re seeing. 
    If you really had no idea where to post this question but you still posted it here, you still shouldn’t have because we have a forum just for you!  It’s called the Where is the forum for…? forum and it’s here:
    http://social.msdn.microsoft.com/forums/en-us/whatforum/
    Moving to off topic. 
    Thanks, Mike
    MSDN and TechNet Subscriptions Support
    Did Microsoft call you out of the blue about your computer?
    No, they didn't.

  • How to delete an Update for an App that is not loaded on phone?

    I have an App Update for an application that is not (and has never been - to my knowledge) loaded on my phone!
    How do I get rid of this update?
    OR should I install it, or try to install and then delete the App. (if it loads).
    This update does NOT show on iTunes site when the phone is connected. (not sure if it would show updates anyway).
    It's a casino games application - so if I install and delete will I get inundated with unwanted gaming Apps?
    And why should I get an update for an App that is not loaded - is this a software glitch, or just speculation by the writers to get some money????
    This phone was pre-owned by family member, and all the updates to date have been for Apps that I have downloaded, during the year or so of my use.

    Hey darwinobambino,
    It seems like you are asking about how to delete some an album on your iPhone. If this album is one that you have downloaded, then you can use the following article to help you delete it:
    iCloud and iTunes Match - iPhone
    http://help.apple.com/iphone/8/#/iphb8d9fd5a6
    Remove a song that’s been downloaded. Swipe left, then tap Delete. The song is removed from iPhone, but remains available from iCloud.
    View only music that’s downloaded. Go to Settings > iTunes & App Store. Under Show All, turn off Music.
    Thanks for being a part of the Apple Support Communities!
    Regards,
    Braden

  • How to increment table key field automaticly?

    Hallo Guys,
    I need to increment ID-field in DB table. Another record in table means id = id+1.
    Is there any FM how to do it dynamicly or automaticly? Or is there a special setting in
    table(data element) so I don't have to do it in my program by inserting new record?
    Thanks.

    You should use a number range with internal numbering , and FM NUMBER_GET_NEXT (NUmber range: Assigns next free number).
    Number ranges are managed by transaction SNRO.

  • HT203426 how to delete an update from update panel?

    I keep getting an error trying to upgrade an app. How do I delete it from the update list? Thanks in advance for any information

    I found the answer...Sorry!

  • How-to create auto-updating fields

    Hello, I'm having a slight problem with user controlled fields on the front panel. I'm using controls in LabVIEW 8.0, and my problem is that when a user enters a new value into a numeric control field, the control does not update and pass that value throughout the rest of the code unless the user presses the <enter> key while the field is still selected. Seems as though there should be an easy fix.
    Thanks in advance.

    Well to specify, what I'm trying to do is create a program for students to use in and education lab, just for simplicity it would be preferred that they not have to press enter at the end of every string of numbers written into a field. The controls that I'm using are governing for loop parameters; the for loop activates with a mouse down event structure. The problem is that if a student enters that they'd like the loop to perform say 500 iterations one time, and they wish for 300 the next; if they don't press enter after changing the value of the numeric control on the front panel the loop will perform 500 iterations again. I have tried using various types of event structures on the numeric control such as "key up" and "key down" however the same problem arises that they enter key must be pressed in order for the value to update.
    I've tried this both on the experiment VI, and a new blank VI with various control-to-indicator set-ups.

  • How to delete an update icon in the system tray?

    I have an icon for an update to Bibg Bar, which I don't want and will only install into IE, which I don't have.
    How do I get rid of it?

    Thank you so much for the prompt reply.
    I have flushed the system restore points as sugested. But running the same SPYWARE DOCTOR program to scan the computer is appearing to be a tedious task! I have recieved blue screen errors for three consecutive times mid-way during the full system scans. The latest one being, "driver caused error in memory pool destined for disk use", exactly which I could not read, the system restarted immediately.
    history of the machine:
    norton anitvirus 2005 crashed during an update around the 20th march,2011. the live update said that the virus definitions were corrupted. I used norton removal tool. I downloaded the Norton antivirus2011 from its website. Initially it worked well but later it also crashed.  Looking in the hardware section for a faulty driver, it highlighted two such drivers:
    BHDrvx86 and Symantec iron Driver. After removing Symantec products completely , these drivers vanished!
    I have tried MS essentials and ENod32 by d/l the trial version from their websites. however, the same result.
    Using the PC Doctor tool through the service partition showed error in the memory and the dvdwriter. However, the drive reads the HP printer s/w but does not read the original music CDs!!
    I had also updated my Service partition by d/l the  R&R new version in january. The computer did not behave as erratically before doing this. Is it possible that a virus was introduced into the service partition and hence the memory is giving me errors?
    please help me out.!

  • How to delete unwanted updates

    After selecting the highlighted update icon the only option is "update all". Can this be bypassed or deleted?

    Mac App Store- Hiding and unhiding purchases
    iTunes Store- Hiding and unhiding purchases
    You cannot remove items from your list of purchases. That is simply a list of receipts kept by Apple for your account.

  • How to delete the unix files automatically using the unix scripts

    Hi
    we have the ADF Project deployed on weblogic server running on top of Linux OS. But, our ADF running project is generating temporary files in weblogic server path below path
    /u01/oracle/product/Middleware/user_projects/domains/based_domain/servers/AdminServer/tmp.
    we are deleting the folders and files existed in TMP directory manually, when size is huge. but, our requirement is to delete the same automatially using the shell scripting based on the time interval say for every 10 hours or 2 days.
    Can anybody please provide us the solution.
    Regards
    Nagaraju Manchala

    Moderator Action:
    @ Nagaraju,
    Your duplicate post of this same exact question,
    that you had placed in the WebLogic Server - Clustering forum,
    has been deleted.
    For future reference, do not ever multi-post. Multi-posting is poor forum etiquette.
    Pick whichever forum you think is most appropriate and place your inquiry.
    You will get a response or you will not get a response.
    There is no obligation, in these free forums populated by end users just like yourself, that a post ever get a response.

  • How to delete a key field in a Transparent table

    Hi,
    I have created a Transparent table Zemployee in which there are 4 fields ( id, name, job, hiredate). I intend to make primary key consists of 2 fields (id, name) but by mistake I have included job field as well.
    Now I want to change job field from a key field to non-key field, I use SE11 to display the maintainance of the Zemployee table, unmarked the key label column on job field then I save and activate the table but the system fail to activate the Zemployee table.
    So now, what shoul I do to solve this problem ?
    Thanks,

    Hi,
    I have tried again and it work well ( use SE14 as you talk). and now I make job field become key-field again and use se11 to change it to non-key field and it work well too. So I think the problem maybe at the network or somethings else.
    Thanks and regards,

Maybe you are looking for

  • Unable to open Smart Objects

    Hi, everytime I try opening smart objects I recieve the following error: 'Could not edit original smart object because of a program error' Installed CC yesterday, working on a mac osx 10.9.2 Can't seem to find any resolve through the forums, any help

  • Anyone else having they're notifications repeated?

    So far I've noticed it happening with Instagram, Mailbox and Facebook. 90% of them come form IG, and only once has it happened with the others. It's only been going on for about 3 weeks. All my apps are up-to date. With Instagram, a single 'like' or

  • Adobe Flash states successful when downloaded, however it will NOT work and disappears?

    I've tried numerous time to install, uninstall and install again flash player from adobe. I go to watch a video and it still states I need to update to newest version even after doing so. I'll shut down my computer and when I turn on my computer it's

  • Help with iPhoto 11

    I have about 2000 duplicated photos.  Is there an easy way to only delete the photos that are duplicated??

  • Upgrading from 4.0 to 4.1

    Hello All, we are on Business Objects 4.0 SP6 Patch 3 and planning to move to Business Objects 4.1 SP2. Whats the best way to go about this process 1. I read upgrading from 4.0 to 4.1 has many issues. any suggestions? 2. Separate install of 4.1 is re