SP not saving records as expected

Hi folks, I’m not sure why my SP is not saving the data as expected, instead of saving the data within the designated record set i.e. where LinkID = @LinkID, it creates a new record....
What have I done wrong...
GO
ALTER PROCEDURE [dbo].[AddTermsCondition]
/******tblLink_OrderProduct******/
@Terms bit,
@TermsEmail bit,
@LinkID int
AS
SET NOCOUNT ON
SELECT LinkID
FROM Link_OrderProduct
WHERE LinkID = @LinkID
BEGIN
Begin TRANSACTION
INSERT INTO [TyreSanner].[dbo].[Link_OrderProduct](Terms, TermsEmail)
VALUES (@Terms,@TermsEmail)
COMMIT TRANSACTION
END

Hi folks, I’m not sure why my SP is not saving the data as expected, instead of saving the data within the designated record set i.e. where LinkID = @LinkID, it creates a new record....
What have I done wrong...
>>  instead of saving the data within the designated record set i.e. where LinkID = @LinkID, it creates a new record
Hi,
I HIGHLY recommend to learn basic SQL!
We can help in any nees probably, but do you really want to waste your time, to write a new question each time, while you can learn the basics in 1 week, and then even help others? for more complex need or for question during learning it will be our pleasure
to help you. I might be wrong, but I am guessing that you did not tried to learn the basic till now, in ordered manner :-(
* your query insert new row to the table since you wrote a simple insert query, instead of UPDATE query. check Jingyang's
solution.
This is short tutorial to learn SQL (SQL is the basic language for all common databases which works with tables). In one week you can learn the language and become "expert" :-)
Next you can learn the extantion language for SQL Server which named transact-sql :-)
http://www.w3schools.com/sql/
** I might be mistaking and the explanation is not clear :-)
if you want to do more then "just" update, then pls clarify. You might want to do INSERT if the LinkID is not exist and UPDATE if it is exist. In this case you can use MERGE statement as explained here: http://msdn.microsoft.com/en-us/library/bb510625.aspx
  Ronen Ariely
 [Personal Site]    [Blog]    [Facebook]

Similar Messages

  • Windows phone 8.1 not saving recorded video

    This is now a huge problem i have recorded a video of around 10 minutes when i stopped and pressed back all my app tiles goes blank so i switched off and then switched on the device guess what i got the video but it was half. Half if the video got freezed and just sound was coming and in between my video was lagging now what the **bleep** was that all about this time it was too much all my friends was insulting me was telling me to get an android windows sucks and all that stuff Microsoft dont just sit do someting no file manager guess what company which is making OS from 90s which can make a great words best selling operating system xp cant even make a great stable non lagging os for a mobile phone microsoft dont just sit work hard i am not getting any progress this is all i can doo now its up to you....

    You can submit your report in here http://social.msdn.microsoft.com/Forums/en-US/home?category=wpprevdev

  • MAC Mail not saving all sent items

    Hi,
    I'm using OS X 10.6.7 and using MAC Mail over an IMAP connection.
    For some reason this particular MAC Mail is not saving / recording all sent emails. The recipient is receiving them all so they've definitely been sent, but they're not appearing in the sent items / sent folders.
    I have tried exactly the same IMAP account on another OS X 10.6.7 mac and ALL emails appear in the sent items.
    It seems there is a fault / bug with the MAC Mail. Is there any hotfixes out there or any steps to try to ensure evry sent email is logged / saved in the sent folders?
    Thanks
    Chris

    Chris,
    I have nearly the exact problem. The only thing I have noticed is it only seems to happen with the first email I have sent out. I can have the mail program open for awhile and do other things but when I write a new email and send it, it doesn't show up in Sent. It also happens if my first email is a Reply. I have to write to the person I sent the email to and ask them to forward it back to me so I have a copy!
    All subsequent emails are saved in my Sent folder.
    I cannot yet consistently repeat the problem. Saving the mail in the Sent folder works 95% of the time.
    I think because it is the first email I send out it catches me off guard. I usually open the mail program and start typing a new email, send it and then go about doing other things, then later I realize it's gone. I even check the online mail at me.com and it's never there either.
    This all started maybe 2-3 months ago.
    Phillip
    Macbook Pro7,1
    10.6.7

  • ABAP - BDC transaction not saving changes to records

    I am trying to write my first ABAP code using BDC recording.  Essentially I would like to flag the "Final Delivery" field (EKPO-EGLKZ) for a range of documents by recording transaction MASS.
    The code runs without errors - but the changes are not saved.  I have run the code in "Processing Mode: A" (Display all screens) and the program successfully loops through each record & saves the updated fields.  When I look at the documents in ME23N the changes have not been saved.   Running the MASS transaction manually results in the changes being successfully saved so I can rule out any data validation issues.
    Does anyone know why the changes refuse to save when running the code below?
    I have considered trying to use BAPI_PO_CHANGE instead of BDC, but I am new to ABAP and I thought the BDC code would be less complex.
    report Z_MASS_REMOVE_FDI_DCI
           no standard page heading line-size 255.
    include bdcrecx1.
    TYPES: BEGIN OF ty_tab,
    MASSOBJTYP(7),
    MASSVARNAM(7),
    DOCNO(9),
    ITEM(1),
    END OF ty_tab.
    DATA : it_tab TYPE STANDARD TABLE OF ty_tab.
    DATA : wa_tab TYPE ty_tab.
    START-OF-SELECTION.
    CALL FUNCTION 'GUI_UPLOAD'
    EXPORTING
    filename = 'X:\STO.TXT'
    * FILETYPE = 'ASC
    has_field_separator = 'X'
    TABLES
    data_tab = it_tab
    EXCEPTIONS
    file_open_error = 1
    file_read_error = 2
    no_batch = 3
    gui_refuse_filetransfer = 4
    invalid_type = 5
    no_authority = 6
    unknown_error = 7
    bad_data_format = 8
    header_not_allowed = 9
    separator_not_allowed = 10
    header_too_long = 11
    unknown_dp_error = 12
    access_denied = 13
    dp_out_of_memory = 14
    disk_full = 15
    dp_timeout = 16
    OTHERS = 17.
    END-OF-SELECTION.
    LOOP AT it_tab INTO wa_tab.
    WRITE:/ wa_tab-MASSOBJTYP,
    wa_tab-MASSVARNAM,
    wa_tab-DOCNO,
    wa_tab-ITEM.
    PERFORM open_group.
    perform bdc_dynpro      using 'SAPMMSDL' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MASSSCREEN-OBJECT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MASSSCREEN-OBJECT'
                                  wa_tab-MASSOBJTYP.
    perform bdc_field       using 'MASSSCREEN-VARNAME'
                                  wa_tab-MASSVARNAM.
    perform bdc_dynpro      using 'SAPMMSDL' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MASSSCREEN-OBJECT'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=NEXT'.
    perform bdc_dynpro      using 'SAPLMASS_SEL_DIALOG' '0100'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MASSFREESEL-LOW(01)'.
    perform bdc_field       using 'MASSFREESEL-LOW(01)'
                                  wa_tab-DOCNO.
    perform bdc_dynpro      using 'SAPLMASS_SEL_DIALOG' '0100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MASSFREESEL-LOW(02)'.
    perform bdc_field       using 'MASSFREESEL-LOW(02)'
                                  wa_tab-ITEM.
    perform bdc_dynpro      using 'SAPLMASS_SEL_DIALOG' '0100'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=CRET'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MASSFREESEL-LOW(01)'.
    perform bdc_dynpro      using 'SAPLMASSINTERFACE' '0200'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=FDAE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'NR_ITEMS'.
    perform bdc_dynpro      using 'SAPLMASSINTERFACE' '0200'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=SAVE'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'NR_ITEMS'.
    perform bdc_dynpro      using 'SAPLMASSMSGLIST' '0300'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'REOML-MSGTXT(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=EXIT'.
    perform bdc_transaction using 'MASS'.
    ENDLOOP.
    PERFORM close_group.

    Where is BDC_INSERT.
    If u use OPEN and CLOSE_group u need to use INSERT_GROUP also to update in database.
    A session will be created and u nedd to run the Session in Sm35 in order to update the database.
    Edited by: Ranjith Kumar on Sep 18, 2008 6:41 AM

  • New records not saved

    there are 3 main data block in a form. Block A is master of block B(multiple row block) while B is master of C(multiple row block).
    Initially, I enter 1 row in A, 1 row in B and 3 rows in C. So, 5 records are saved. Anyway, when I execute the form later... and want to insert another row in B and another 3 rows in C. These new records are not saved.
    Can anybody help me on this ?
    Thanks,
    Shu Wen

    Howdy Howard (and others) -
    I was hoping someone would have an answer without generating an example, but I hi-jacked the demo and came up with one:
    http://apex.oracle.com/pls/apex/f?p=70849:9:16222360984434:::::
    Workspace: DenverScott
    UserName: Test_User
    P/W: Test123
    Page: 9
    Recreate Problem: Change the checkbox value of an item under OnChange and OnClick and press "Submit", only OnChange items actually change.
    On this report, the two columns "OnChange" and "OnClick" are the focus. They are both simple check boxes and basically have the same settings. They both call an empty javascript function "test_me(this)" when clicked. Difference is, the MRU works for the "OnChange" column, updates are applied. You can change the "Onclick" column and submit all you want and it does nothing.
    If you remove the event for OnClick="test_me(this);" from the "OnClick" column, the submit/updates work just fine.
    (If anyone changes the demo, please return to prior state for others to examine)
    Thanks,
    Scott

  • HT4972 will the info in my apps (Passwords, notes and records) be saved when I update to iOS5

    will the info in my apps (Passwords, notes and records) be saved when I update to iOS5

    Yes, as long as you back up the iPod first via iTunes before performing the update.  Use the instructions in this Apple support document to walk you through the upgrade process.
    iOS: How to update your iPhone, iPad, or iPod touch
    B-rock

  • Korean characters displays properly in application, but not saved in DB properly

    Korean characters are retrieved and displayed properly in VB6 application.  But upon record insertion, it is not properly saved.  See below before and after screenshots.
    Retrieval and display of original record
    Retrieval and display of saved record
    We have tried with setting of "keeporgmultibyte", "set char_convert off", "ODBC User Specified Character Set cp850", unfortunately nothing worked.
    Please see below for details of our ASE.
    ODBC Driver Installer: Sybase Adaptive Server Enterprise PC Client 12.5.4 GA
    ASE ODBC Driver Version:  12.05.01.510
    ISQL -V
    SELECT @@VERSION
    SP_VERSION
    SP_HELPSORT

    I don't have any direct experience configuring ASE for use with Korean text, however cp850 seems like an odd choice for Korean.  I would expect utf8 (particularly if data in other languages were being stored as well) or cp949. Korean Character Set.
    I don't think version has anything to do with your issue, but why on earth would you still be running on 12.5.4?
    End of Life Notice for Adaptive Server Enterprise (ASE) 12.5.X End of Life Notice: Database Management - Sybase Inc

  • Voice memos app not saving properly

    I am using an iphone5 running iOS7.1.1 and performing the following actions will cause Voice Memos app not saving recordings. I have sent a feedback to Apple but is wondering if anyone else is found having similar problems.
    1) Run Voice memos app and start recording
    2) At lock screen open camera app and take a picture
    3) At same lock screen delete the picture taken
    4) Lock screen will show RECORDING in progress
    5) Open Voice memos app and it will also show RECORDING in progress
    6) Save voice memo from app and the duration FROM the point of picture deleted WILL NOT be saved

    same here ... iPhone 3gs/32 gigs ram/ios 4.3.1 ...
    the app doesn't seem to work any more, and hasn't for some time:
    "buttons" are unresponsive, or they appear to respond, but don't perform their function ... erratic behavior ...
    very disappointing as this has gone on for some time ...
    We appear not to be the only ones ...
    Anyone with a solution?
    Thanks

  • Downloads of updates not saving, no prompts or icons in the Application folder-how do I ensure updates are saved?

    I am following the instructions to download v 6 but receive no prompt to move the Firefox icon to the applications folder. I have done that anyway, but it's not saving-the latest version is July 11. I then get reminders to update all the time-what am I doing wrong?
    I am working on a Mac laptop

    A lot of people panic when they see Photoshop displaying differently from other software. But that's normal and expected. Here's what happens:
    1. Photoshop is color managed and performs a document profile > monitor profile conversion when it displays. So whatever the document profile is, Photoshop will display correctly - unless you have CM policies set to "off" (...!)
    2. Other applications, including many web browsers, aren't color managed and will just send the file numbers directly to the display. This distinction is extremely important, because there will be a slight difference. Again, that's normal. Photoshop is right and the other apps are wrong.
    3. Without color management, it all hangs on how your monitor displays color. Most monitors are so close to sRGB that any sRGB file will display roughly correctly. This is why sRGB is the de facto web standard: it can live without color management. And that's why you should always convert web material to sRGB. Yes, that's the Edit > Convert to Profile option. You can also use Save For Web to do this if you check the appropriate boxes.

  • Enhancement in IDOC_INPUT_ORDERS not saving changes after order creation

    I have an enhancement at the beginning of the IDOC_INPUT_ORDERS function module used to create sales orders via EDI.  In the enhancement, I take the data records and make some changes to some quantities and units of measure.  After making these changes, I let the function module continue on as normal.  The order does get created with my changes in them, however, the IDoc doesn't reflect my changes.
    Here's an example:  An EDI order comes in with 6 EAs of a material.  In my enhancement, I change it from 6 EAs to 2 3PK.  I then let it go on its way.  The order gets created fine with 2 3PKs, however the IDoc after its a ll done still says 6 EAs. 
    The enhancement runs before the FM puts the data into the tables it uses. I tried using the last user exit to open the IDoc and editing it there using the EDI_DOCUMENT_OPEN_FOR_EDIT FM but it says its open. 
    Can anyone give me any clues on how to make my changes stick to the IDoc?
    Thanks,
    Curtis

    Ok, I figured out why it's not saving.  Not realizing it, but the tables are passed into the FM by reference, so what I'm changing is only a copy.  So what I tried to do is use the 004 (I've also tried the 005) user exits to try to update the actual DB.  I used the following FMs (EDI_DOCUMENT_OPEN_FOR_EDIT, EDI_CHANGE_DATA_SEGMENTS, and EDI_DOCUMENT_CLOSE_EDIT).  The problem is that I can't change them because the IDoc is still open.
    Does anyone have any ideas on how I can achieve my goal of changing the IDoc?
    Thanks,
    Curtis

  • Error while saving record in SharePoint 2013 through jQuery

    Dear Support,
    I had successfully created provider hosted app and deployed on SharePoint 2013 online site, in my project I created
    orderservice.asmx.cs web service and write a code for save record on SharePoint 2013 online list as I mentioned below and calling on App1.js file.
    But I am facing error when I am saving record on SharePoint 2013 list on button click event
    “500 Internal Server Error
    <! DOCTYPE html>”
    <html>
    OrderService.asmx.cs
    Public
    int InsertOrder (Order
    orderRecord)
    pwd.MakeReadOnly();
    clientContext.Credentials = new
    SharePointOnlineCredentials (myUserName, pwd);
    try
    Web oWeb = clientContext.Web;
    ListCollection lists = oWeb.Lists;
    List oOrderlist = lists.GetByTitle("Order");
    clientContext.Load<ListCollection>(lists);
    clientContext.Load<List>(oOrderlist);
    ListItemCreationInformation listItemCreationInfo
    = new
    ListItemCreationInformation();
    var listItem = oOrderlist.AddItem(listItemCreationInfo);
         listItem["Title"]
    = orderRecord.OrderProfile;
    listItem["Special_x0020_Instruction"]
    = orderRecord.Instruction;
    listItem ["Customer"] = orderRecord.CustomerId;
    listItem.Update();
           clientContext.ExecuteQuery();
    return 1;
    catch
    return -1;
    App1.JS
    $("#Save").click(function
    debugger;
    var OrderProfile = $('#orderprofile').val();
    var CustomerId = $('#exCustomerlist').jqxComboBox('getSelectedItem');
    var Instruction = $('#instruction').val();
    $.ajax ({
    url: location.pathname + "OrderService.asmx/InsertOrder",
    type: "POST",
    dataType: "json",
    data: "{OrderProfile:'" + OrderProfile
    + "', CustomerId:'" + CustomerId.value
    + "', Instruction:'" + Instruction
    + "}",
    contentType: "application/json; charset=utf-8",
    beforeSend: function (XMLHttpRequest) {
    //Specifying this header ensures that the results will be returned as JSON.
    XMLHttpRequest.setRequestHeader("Accept",
    "application/json");
    success: function (response) {
    $(".errMsg ul").remove();
    var myObject = eval('('
    + response.d + ')');
    if (myObject > 0) {
                                         alert(myObject);
    $(".errMsg").append("<ul><li>Data
    saved successfully</li></ul>");
    else {
    $(".errMsg").append("<ul><li>Opppps
    something went wrong.</li></ul>");
    $(".errMsg").show("slow");
    clear();
    error: function (response) {
    alert(response.status + ' ' + response.statusText
    + ' ' + response.responseText);
    would request for your support.
    Regards,
    Akhilesh

    Hi,
    Can you call your web service using jQuery not in an app successfully?
    As the error message suggests, it might be an error on the server side.
    I suggest you do a simple test to check whether you can call the web service using jQuery.
    Here are two links would provide more information about troubleshooting this error for your reference:
    http://sadomovalex.blogspot.com/2013/08/return-json-from-asmx-when-call-it.html
    http://www.codeproject.com/Tips/761116/Troubleshooting-an-Issue-With-Calling-an-asmx-Web
    Feel free to reply with the test result if the issue still exists.
    Best regards
    Patrick Liang
    TechNet Community Support

  • Error while saving record "User:johndoe":     Error -14071

    I have added my augmented users from the AD server. When I select user and to apply a setting under Preferences I get this on attempting an "Apply", Error while saving record "User:johndoe":Error -14071. I'm authenticating to my LDAP not AD/All Domains.
    I have the server bound correctly to the AD server. Bound to AD, then promoted to OD master.
    Tried WGM from another Mac, same error.
    I recall my AD admin extending the ad schema last year for OS X 10.4.
    Thoughts? Thanks.

    Thanks David and Mabel, and all for the suggestions. I did go through "Leveraging Active..." prior to posting. I did try your method of canceling the authorization to WGM and viewing Directories. I would select a user from this method and try to apply something from MCX, but still got the -14070 error. Yes, I do have my client bound 1st OD, 2nd AD, with OD first on the search policy for the client.
    I though I had solved my issue by authenticating to WGM and LDAP. Then selecting Groups and the Members tab, I define an OD group and select that group. I can then click the "+" towards the right of the window. Then select my AD there which populates. I can add my AD groups or single users to my OD group. Then I'm able to apply MCX settings. But, no "blue" circle next to the group's silhouette. How is my method possibly incorrect?
    Also, at some point I unbound my client from AD and it seems the client is ok with getting AD info off my OD server. Example, my AD sharepoint mounts for PHD.
    But, I do have a pause of 20 secs. are more when logging into the client as well as accessing applications. Side effect of my method?

  • HP LaserJet Pro 400 M401a Laser Printer Not Saving Downloaded Fonts

    Hi,
    we have recently purchased an HP LaserJet Pro 400 M401a Laser Printer which needs to be used with a system that downloads fonts for correct style printouts. The problem I am having is the fonts download initially which is great, but they are not saved by the printer after 1 printout so the user is having to download the fonts everytime she wants to print something.
    All other printers in the office are HP2055 and work as expected saving the fonts after the initial download. I have asked the support team of the application to have a look at the situation and they say everything is setup correctly so it may be an issue with the printer. Printer is installed on a Windows XP SP3 PC.
    Firware version: 20121205 (15 Dec 2012)
    Driver Version: 61.140.04.14138 (1 Jan 2013)
    Any help would be appeciated, thanks.
    Robert

    If the downloaded soft fonts are definitely not being saved (despite the download presumably terminating with a 'make soft font permanent' escape sequence), then the problem must lie in the firmware - and the only resolution is if HP releases  a new version with a fix.
    To be certain about which PCL5 fonts are resident in the printer, you have presumably printed off a  'PCL5 Typeface List' via the relevant front panel menu (assuming this printer has one).
    Or you could send the following direct to the printer to invoke that report:
    <Esc>%-12345X@PJL COMMENT Print PCL Font List
    @PJL DMINFO ASCIIHEX = "040004010105020402015E"
    <Esc>%-12345X
     where <Esc> represents the non-graphic) Escape control-code character (the character with decimal code 27, or hexadecimal 1B), and each PJL statement is terminated with a LineFeed control-code (decimal 10, hexadecimal 0A).
    Assuming that the printer is USB-connected, you could send the contents of the file (name, say, testfile.prn) holding the above to the printer using the copy command in a command-prompt session:
    copy /b testfile.prn \\computer-name\share-name
     where:
    computer-name is the name of the host workstation
    share-name is a share name of the installed Windows printer instance.
    I don't have access to your model of printer, but I do use a LaserJet Pro 400 Colour MFP 475dn (MFP equivalent of M451 printer), and this does appear to retain downloaded 'permanent' soft fonts - but only until the device goes into 'sleep' mode!
    So it is probably a common 'fault' (or 'design decision'?) across this family (LJ Pro 400) of printers.

  • CRM sales order is not saved in CRM but in ECC

    Hi,
    I am new CRM area and will not some hints on where to check.
    When the the Sales orders are successfully created in CRM, they are replicated to R/3 but the sales orders are not saved in CRMD_ORDERADM_H table of the CRM system.
    Also, I dont know see any details of the sales order in the interaction record document flow.
    Can you please help me with any hints on where to check to fix this issue..

    Hi Sangameshwar,
    In CRM you can have two scenarios for ERP Sales Order.
    1. ERP Sales offer and Sales order, using the CRM User Interface to create directly the ERP Sales Documents with LORD interface. The document is only saved in ERP. I believe this the scenario you are using.
    2. CRM Sales offer and Sales order, the document is saved both CRM and ERP. The documents are replicated via Middleware.
    In both scenarios the interaction record should add the document in the doc. flow, it's probably a missing customizing in the interaction record.
    Hope this information help you.
    Regards,
    Jorge G.

  • Sent messages from secondary account are not saved in Outlook 2011 for Mac

    We are using a shared email account added in Outlook 2011 for Mac.  It's not the default account but we send from it often.
    Whenever sending from this secondary mailbox, the message is not saved in sent items folder under the secondary mailbox or the default mailbox.  There seems to be no record of the sent item anywhere.
    I verified the message is sent and received.
    All microsoft updates have been applied and we are using Exchange 2010.

    Hello,
    Please first log into OWA and check if the email are saved in the Sent Items folder.
    We can tick the option "Save copies of messages in Sent Items folder" in Outlook 2010 and Outlook 2013 to save a copy of sent message, please check if you get such option in Outlook for Mac.
    In addition, in Outlook for Windows, we can change a registry key to force Outlook to save sent emails in the default or secondary mailbox, but I'm not sure if Outlook 2011 has such trick. See:
    http://www.msoutlook.info/question/278
    Since this forum is general questions and feedback related to Outlook for Windows, it's better to post your question to the forum for Mac:
    http://answers.microsoft.com/en-us/mac/forum/macoffice2011-macoutlook?sort=lastreplydate&dir=desc&tab=Threads&status=&mod=&modAge=&advFil=&postedAfter=&postedBefore=&threadType=All&tm=1395990325271
    The reason why we recommend posting appropriately is
    you
    will
    get the most qualified pool of respondents,
    and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thank you for your understanding.
    Best Regards,
    Steve Fan
    Forum Support
    Come back and mark the replies as answers if they help and unmark them if they provide no help.
    If you have any feedback on our support, please click
    here

Maybe you are looking for