Update several data simultaneously in a database

Hello all,
Who can help me on this : I am trying to update simultaneously all data returned with a simple cfoutput query, where all form tags are indexed with all the id(s) returned by the query (same serie of input/textarea/etc. for each id, but only one single validation button for all id). I am stuck and cannot find a way to do this. Would someone have a simple example of how I could proceed ? That would save my life...
Thanks
Jean

I've done that a few times.  I just found one of the pages and the logic for updates went like this.  By the way, my form is like yours, where the record id is at the end of the form field name.
First, I ran a query against the database to get exisitng values.
Then, I created a ColdFusion query called formdata.  Then I populate this by looping through the form fields.  Something like this:
<cfloop list="#form.fieldnames#" index="ThisField">
<cfif left(thisfield, 9) is "newrecord" and len(form[thisfield]) gt 0>
code for new records
<cfelseif left(thisfield, 4) is "name">
<cfscript>
ThisCode = RemoveChars(ThisField, 1, 4);
if (len(form[thisfield]) gt 0 ) {  // possible update
// handle commas in the text
ThisValue = replace(form[thisfield], ",", "|^|", "all");
// addNewRow is a udf I wrote that combine QueryAddRow and QuerySetCell
x= addNewRow(formdata,"id,f_organism","#Thiscode#,#ThisValue#");
x = QuerySetCell(formdata,"f_organism", Replace(ThisValue, "|^|", ",", "all"));
else { // delete
DeleteList = ListAppend(DeleteList, ThisCode);
</cfscript>
Then I do a query of queries to identify the records to update.
<cfquery name="RecordsToUpdate" dbtype="query">
select id, f_organism
from formdata, existingdata
where id = organism_id
and f_organism <> organism
</cfquery>
and update them like this:
<cfloop query="RecordsToUpdate">
<cfquery name="update" datasource="infograms">
update organism
set organism = <cfqueryparam cfsqltype="cf_sql_varchar" value="#f_organism#">
where organism_id = <cfqueryparam cfsqltype="cf_sql_char" value="#id#">
</cfquery>
</cfloop>
Then I do my deletions.

Similar Messages

  • How to update transaction data automatically into MySQL database using PI

    Dear All,
    With reference to subject matter I want a sincere advice regarding how to update transaction data automatically into MySQL database using PI. Is there any link available where I can get step-by-step process.
    Ex: I have a MYSQL database in my organization. Whenever a delivery created in SAP some fields like DO Number, DO quantity, SO/STO number should get updated in MYSQL database automatically.
    This scenario is related to updation of transactional data into MYSQL DB and I want your suggestions pertaining to same issue.
    Thanks and Regards,
    Chandra Sekhar

    Hi .
    Develop a sceanrio between SAP to Database system,When the data updates in SAP Tables read the data and update it in DATA Base using JDBC adapter,but there will be some delay in updating data in MySQL.
    serach in sdn for IDOC-TOJDBC sceannario,many documents available for the same.
    Regards,
    Raja Sekhar

  • Update a date field in SQL database

    I am using MS SQL 2000..and .Jdbc-odbc bridge
    I have a field of type datetime...
    I am trying to update that field value...using the following code
    rs.updateDate(fieldname,java.sql.Date.valueOf(fval));
    rs.updateRow();
    where fVal is a string...
    It gives me a SQl Exception saying invalid date value..
    Can any throw any light on this...helping me to overcome my error...

    This problem is solved...I am just inserting it as a string and the database takes care of everything...Now I have problems in inserting Integer value and a ntext value..
    rs.updateInt(colname,1);
    rs.updateRow();
    This inserts a very big number like 1427560 etc into the database and second time it puts 0 to it...
    For ntext it does not do anything
    smita

  • Update/insert/delete data from xcelsius to Database via web service

    Hi,
    I need to create dashboard that go function can <b>update/insert/delete</b> data send to <u>Database</u> thru <u>web services</u>, as i know got 2 xcelsius add-on software which support those of function <b>InfoBurst</b> and <b>flynet </b>
    <b>InfoBurst</b>
    http://www.infosol.com/azbocug/minutes/4-Writeback%20to%20a%20Database%20with%20Xcelsius.pdf
    <b>flynet </b>
    http://www.flynetviewer.com/public/community/Blogs/FlynetXcelsiusServerUser/default.aspx
    Except this 2 purchase add-on xcelsius, any other solution ?  
    Maybe need to write some in MSSQL or C# programming which enable insert, update, delete ...etc  ?
    *note: i not use Xcelsius Engage Server , i use Xcelsius Engage only
    thanks,
    regards
    s1
    Edited by: Leong Pui Kee on Mar 1, 2011 6:06 AM

    Hi,
    As of now in Xcelsius/Dashboard Design there is no feature or functionality to insert/update/delete data from database.
    Solution:
    Create a Web service in let’s say C# or Java, which will perform insert/update/delete operation.
    In Xcelsius add Web Service connection and user above web service.
    Xcelsius Web Service connection provides option to pass input values to a Web Service (Input Pane) and get the result (Output values pane).
    We can pass values to be written to the database as a input to Web Service via Web Service connection from Xcelsius and write data to the database.
    Note:
    Performing delete operation from Xcelsius Dashboard could be risky and may delete important data from database. I would not prefer giving delete option/functionality in Xcelsius dashboard.
    Hope this helps!
    Thank you.
    Regards,
    Vinay Mhaske

  • Updating array data in sql database

    HI,
    Im facing problems in updating array data in SQL database.
    As of now, i am able to write an "insert" query and insert array data in an image datatype field. Im using image datatype because the array size is very big(around 80,000 x and y values).
    Althoug inserting data is easy im unable to write a query to update this data.
    Referring to the help of SQL server and Labview database connectivity toolkit, i came across a method of accessing image datatype....using textpointers, which are 16 bit binary values and using the WRITETEXT function instead of the UPDATE function.
    but the problem im facing is that ive to pass the array as a 2d string array in the query as a result the updated array is retrieved in the form of a string a
    nd not as an array. how do I get over this problem?

    Hi Pavitra,
    I'm not very clear on how you have inserted the data into your application, but I do know that when you call the UPDATETEXT or WRITETEXT function you use the TEXTPOINTERS to point to the first location of a 1d array. So, depending on how you've stored the data, you may have problems updating your data if you're looking at it as a 1d array instead of how you originally formatted it. If you are able to successfully access the data as a 1d array, you can use the database variant to data type vi and pass in a string array constant for the data type. This will convert the variant datatype into whatever you specify. You may have to index the row and column of the variant (you receive a 2d array of variant) first before you convert. If possible, can yo
    u provide some more detail and maybe some example code of how you perform the insert and plan to do the update? I can probably give you a better solution if I know how you are formatting the data. Thanks!
    Jeremy L.
    National Instruments
    Jeremy L.
    National Instruments

  • Looping SelectedItem values in HttpService to Update Several Rows in Database in Flex

    Hi,
    My client wanted me to create something that allows certain
    DataGrid to display to allow users to edit and update the database
    records. The only dilemma I am having here is how to actually
    create something from Flex's end to allow users update several rows
    of the database at once. Since everything in my datagrid would be
    defined as selectedItem whenever a user accesses the entry, how can
    I get Flex to recognize each of the updated variables while I
    update the database?
    Another question is, if I do something like
    dg2.selectedItem.id, it would only display the "selectedItem," and
    since I intend to loop every single one of the values as such in
    the datagrid to be updated, is it possible to do something like dg.
    .id? I tried to do this, and I kept on getting errors.
    If anyone could refer me to some examples on how to get this
    to start, it would be great.
    Thanks in advance.
    Alice
    This is the current code I have:
    <mx:HTTPService id="save_scenario" method="POST" url="
    http://localhost/save_scenario.php"
    useProxy="false">
    <mx:request xmlns="">
    <scenario_name>{scenario_name}</scenario_name>
    <id_no>{dg2.selectedItem.id}</id_no>
    <region_name>{dg2.selectedItem.region_name}</region_name>
    <population>{dg2.selectedItem.population}</population>
    <market>{dg2.selectedItem.market}</market>
    </mx:request>
    </mx:HTTPService>

    Thanks, but I think I will be a little more explicit here
    about what I really wanted to know. My impression is that if I have
    a DataGrid and that I would like to allow users to edit certain
    entries within the actual grid and have all of it saved to the
    database, I could use a for loop and just update everything without
    paying attention to what has really been updated, but I have been
    struggling with how to pass it all to the variables side.
    Currently, I could update things one entry a time, by using the
    code I provided earlier, but is there a way of which I can have it
    all posted to the HTTPService in one go?
    Note: I tried using dg.
    .id_no in the for loop to iterate over the variables I intend to
    post, but I don't think I am allowed to do so, do I?
    Alice
    Attached is what I used in a PHP script to allow the code
    loop around the users' edits, how could I do the similar thing in
    Flex by assigning the index variable to something more dynamic?
    Attach Code
    <?php
    if(!isset($_POST['npop'])){
    // this is where the user will select how many pops to insert
    ?>
    <form method="post">
    <input type="text" name="npop" value="Type in how many
    post values">
    <input type="submit" value="Continue">
    </form>
    <?
    } else {
    if(!isset($_POST['pop'])){
    $pop = $_POST['npop'];
    // when the user has selected the N number of pops
    // its time to create the N input elements
    ?>
    <form method="post">
    <input type="hidden" name="npop"
    value="<?=$pop;?>">
    <input type="hidden" name="pop" value="0">
    <?
    for($i = 1;$i <= $pop; $i++){
    echo "<h3>Pop $i</h3>";
    // now comes the 5 input elements..
    // add them as u like naming them in the following pattern,
    // or whatever prefix
    ?>
    Market: <input type="text" name="a<?=$i;?>"
    value="0"><br />
    IM_accept: <input type="text" name="b<?=$i;?>"
    value="0"><br />
    IM_defer: <input type="text" name="c<?=$i;?>"
    value="0"/><br />
    CR_accept : <input type="text" name="d<?=$i;?>"
    value="0"><br />
    FC_accept : <input type="text" name="e<?=$i;?>"
    value="0"><br />
    <?
    ?>
    <input type="Submit" value="Submit form">
    </form>
    <?
    } else {
    $pop = $_POST['npop'];
    // when the user has submitted the pops,
    // they will be inserted to N rows in the table.
    for($i = 1; $i <= $pop; $i++){
    $a = $_POST['a'.$i]; $b = $_POST['b'.$i]; $c =
    $_POST['c'.$i];
    $d = $_POST['d'.$i]; $e = $_POST['e'.$i];
    $sql = "insert INTO table VALUES('$a', '$b', '$c', '$d',
    '$e')" . "\n";
    echo $sql;
    $myFile = "testFile.txt";
    $fh = fopen($myFile, 'a') or die("can't open file");
    fwrite($fh, $sql);
    fclose($fh);
    echo "POPs were recorded. Thank you";
    ?>

  • Can we update the data from SSRS report to any database ?

    Hi Team,
    Greetings !!!!
    Can we update the data from SSRS report to any database ?
    Thanks,
    Anand Gavle.

    Nope SSRS doesnt have write back options. Its just a reporting tool
    However one thing you can do is to link a webpage from SSRS report and do the changes through it
    SSRS has the ability to navigate to web page through which you can capture any data inputs from users and save it to your db.
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Control file not updated till date in RAC two node database

    Hi,
    Good day.
    To my surprise i found that control files, in our database RAC with two nodes, are not updated till date except one from node 1 and another from node 2.
    But we got all the controlfile names in the init parameter file, in both the nodes.
    Node 1
    bash-3.00$ ls -lrt
    total 922128
    -rw------- 1 oracle dba 157286400 Nov 3 2007 cntrl03.dbf
    -rw------- 1 oracle dba 157286400 Nov 3 2007 cntrl02.dbf
    -rw------- 1 oracle dba 157286400 Apr 12 17:21 cntrl01.dbf
    Node 2
    bash-3.00$ ls -lrt
    total 922128
    -rw------- 1 oracle dba 157286400 Mar 30 09:17 cntrl03.dbf
    -rw------- 1 oracle dba 157286400 Mar 30 09:17 cntrl02.dbf
    -rw------- 1 oracle dba 157286400 Apr 12 17:20 cntrl01.dbf
    As you could see cntrl01.dbf is the only file updated till date in both the nodes. The database is running fine.
    what is actually happening?
    Any suggestions?
    Thanks,
    Balu.

    As you're using RAC it is very likely that you are using an SPFILE.
    Connect as a DBA account (or an account with SELECT ANY DICTIONARY privileges) in both the instances and do "show parameter spfile" and "show parameter control" (or query V$parameter)
    It is likely that the spfile is referencing only 1 controlfile.

  • "Failed to update binary data in the database".

    Hi,
    we will get this message ("Failed to update binary data in the database".) when one of our customers want to install our add-on in one specific server.
    they got a copy of their database and put in another computer and could install add-on. but they can not install add-on on their main server.
    please advice me.

    Hi Senthil,
    Thanks for your consideration,
    They checked and they don’t have any record in SARI table related to R1. they have one record for XLR only.
    This problem is only on one specific server.
    Do you have any other idea? Please help us.
    Regards,
    Neda

  • Several concurrent process  can write data simultaneously into

    Several concurrent process  can write data simultaneously into
    a.     Basic Cube
    b.     Transaction Cube

    Assumption: Each row of your data is one channel of N samples. Your 2D array should go through a "Convert Dynamic Data" vi. Right click on the "Convert Dynamic Data.vi" and choose: "2D array of scalars - rows as channels".
    Or post code if that isn't helpful.
    “A child of five could understand this. Send someone to fetch a child of five.”
    ― Groucho Marx

  • How to update the data  in database in webdynpro

    I have to update the data in databse table using adaptive rfc in WebDynPro

    Hi,
    You can refer to these links:
    https://www.sdn.sap.com/irj/sdn/wiki?path=/display/wdjava/faq%2b-%2bmodels%2b-%2badaptive%2brfc
    Update data into SAP Table
    http://help.sap.com/saphelp_nw70/helpdata/en/41/38bc8f813719488ddc9d9b21251ec3/frameset.htm
    http://help.sap.com/saphelp_nw70/helpdata/en/d5/1558bfa6aa80499113983e738b1b21/frameset.htm
    Regards
    Inder

  • How to get data into the mySQL database?

    First some background.
    I have a website that has outgrown its designed dimensions and is a huge burden to maintain. See PPBM5 Benchmark
    There is a lot of maintenance work involved, so I'm investigating a PHP/MySQL approach to easen the burden and to add functionality to the site. With the current Excel based structure and over 420 entries, it is cumbersome for me to maintain, but also for users to find what they need.
    A MySQL based dynamic structure is a lot easier and offers vastly more selection capabilities, like selecting only records that meet specific criteria.
    Data submission is done with a form, that contains most of the relevant data, but the drawack is that people submitting their data are often not technically inclined, give wrong answers due to a lack of understanding or making typo's. The test results are attached in one or two separate .txt files, but often they have not read the instructions correctly or did something wrong, so these attached .txt files can not be trusted automatically, they have to be checked before inclusion.
    These were my initial thoughts:
    1. Data collection:
    To avoid spending all our energy and time  on correcting typo's, getting missing data, correcting errors, I am  investigating the use of CPU-Z in Ghost mode to create a .txt or .html  file that contains all relevant hardware info we need and even more. It gives all the info we currently have, but adds  data like number of memory sticks, DDR timings, stock clock speed and  BCLK setting, video card info and VRAM size, etc.
    To see what I mean, run CPU-Z, go to the About tab and press the Save Report button and look at the results.
    This can all be done without user intervention in an automatic way, but  maybe I need to add an Auto-It file to the test to make it all run as  desired.
    If this works and I'm able to extract the relevant data from the created  file and can insert it into the database, we may be in business for the  next version of PPBM5.5 or PPBM6. It does require a modification to the instructions, making them a lot  easier, because there is less data to fill out.
    2. Data submission:
    The submission form can be simplified if  the CPU-Z data can be used. We have to create an automatic way to attach  the created .html file from CPU-Z to the submission form and we have to  streamline the Output.txt and Output-MPE.txt files to be more easily included in the 'form.lib.php' file. It  currently is manual labor and very time consuming.
    3. Adding to Database:
    I have to find a way to create database  records from the Gmail forms I receive. All incoming mail messages need  to be checked on relevancy and if relevant, need to be added  automatically to the database and then offered for approval before final inclusion in the database. Data included in the database  will then include submission date and time, Email address,  IP address  used, plus links to the files submitted and available on the website.
    4. Publication of the database:
    After approval of new records from step  3, all updates will be automatically applied to the database and  accessible for users. I do not yet intend to introduce a user account ,  requesting login before all functionality is accessible. Too much trouble and administration.
    Queries should be possible on things like CPU (check box), so include  17-920, i7-930, i7-950 but exclude i7-980X and i7-990X, Size of memory  (check box), Overclocked (boolean, yes, no), SSD as OS disk, and similar  options.
    The biggest problem is to keep the color grading and statistical  indicators (Top, D9, Q3, Med, Q1 and D1) intact on dynamically generated  queries. Say you make a query which results in 20 observations, this  should show the related colors and legends. Next query results in 48 observations and of course the color grading and legends  do need to reflect that. Question in my mind, does the RPI remain  constant, independent of the query or does that need to be recalculated  on the basis of the query?
    Next thing is to allow a user to select a specific observation and by  simply clicking on it be shown, in a separate window (detail page) or  accordion, all the CPU-Z related information about the hardware.
    The graphs, Top-20 and MPE Gains, need to be dynamically adjusted, based on the query used.
    5. Ideally, external links:
    In an ideal situation, one could link the  CPU-Z data to external price databases, looking up current prices for  CPU, memory, video card, disks, raid controller, etc. to get instant  BFTB charts, based on the query made. But that is the next step.
    Situation now:
    I have a MySQL database that is easily updated with the new submissions. Simply create a .CSV flie from the submitted forms and import that into the database. The bulk of the initial work is done.Lots remain to be done as you can see above, but that is for a later time.
    Question:
    I have this table, that needs to be filled with data in the submitted and attached files. Mr. X submitted his data and can be uniquely identified by his "Ref_ID". He attached one or two files in .TXT format with the relevant test data. These files are stored on the server with a concatenated name:
    "Ref_ID","-","filename"
    Say his Ref-ID is: 20110204-6cf5 and his submitted file is called: Output(99).txt then the file can be found on the server as
    20110204-6cf5-Output(99).txt
    I need to be able to open that comma delimited file, the contents may look like this: "439","1036","819","531" and insert these contents into the relevant record and fields.
    Graphically,
    is what I want to achieve.
    This being my first exposure to PHP/MySQL, you can imagine I'm not clear on how to go from here.
    Added complication is that I actually have 5 numbers to insert per record and two calculated fields, Total Score and RPI should be calculated fields. Haven't yet figured out how to handle calculated fields, maybe only in the PHP/HTML code and not in the database.
    I hope someone can help me.

    You do have a very complex looking site and may need several tables in mysql to handle all that data. If you knew to phpmysql I would suggest taking a look at this tutorial it will help get you started in understanding how to $_GET info from a database and also how to $_POST data to a database. I am no expert just learning myself and I found this very helpful. This is the link http://www.adobe.com/devnet/dreamweaver/articles/first_dynamic_site_pt1.html
    There are also many tutorials on Youtube to help build a CMS Content Management Site I would suggest the following: -
    http://www.youtube.com/user/phpacademy
    http://www.youtube.com/user/betterphp
    http://www.youtube.com/user/flashbuilding
    And many more on my channel here
    http://www.youtube.com/user/Whisperingonthewind
    CMS's are easier to maintain, add edit and delete content.
    I have also recently bought a Book by David Powers Training from the Source very helpful.
    Anyway hope you get it sorted.

  • What is the best way to put LabVIEW DSC data into an Oracle database?

    I have been collecting data using LabVIEW DSC 7.0 for several years and have always accessed the data from the Citadel database via the Historical Data Viewer.  I would now like to begin putting this data into an Oracle database.  My company stores all their data in Oracle and it would provide me all the benefits of their existing infrastructure such as automated backups, data mining tools, etc.
    My initial thought is to use "Read Trace.vi" in LabVIEW to pull historical data from the citadel database at regular intervals (e.g. 1 minute) and insert this data into Oracle via ODBC.  In this way, I do not need to track the value changes in order to know when to write to Oracle.  I also considered replicating the citadel database using some other method, but I recall that the tables used by citadel are somewhat complicated.  I only need a simple table with columns for channel, timestamp, and data.  The "Read Trace.vi" will provide me data in this format.
    I do not need to update the Oracle database in real time, a few minute delay is acceptable. If anyone has a better idea or additional insight please let me know. Thanks.

    In terms of connectivity, you want to use ADO, not ODBC. Beyond that, it all depends on the structure of the data and what you are going to want to do with it. This is a very big question that you need to be getting some in-depth assistance.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • My iMessages don't work since updating. It says the Messages database is being upgraded, please wait while it finishes or Quit Messages and relaunch it later. How do I get them working again?

    My iMessages don't work since updating. It says the Messages database is being upgraded, please wait while it finishes or Quit Messages and relaunch it later. How do I get them working again?

    Back up all data.
    Quit Messages if it’s running. Force quit if necessary. Relaunch it and test after each of the following steps. If the problem isn't resolved, quit again and go on to the next step.
    Step 1
    Make sure you know the ID and password you use with iMessage. Launch the Keychain Access application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad and start typing the name.
    Select the login keychain from the list on the left side of the Keychain Access window. If your default keychain has a different name, select that.
    If the lock icon in the top left corner of the window shows that the keychain is locked, click to unlock it. You'll be prompted for the keychain password, which is the same as your login password, unless you've changed it.
    Right-click or control-click the login entry in the list. From the menu that pops up, select
              Change Settings for Keychain "login"
    In the sheet that opens, uncheck both boxes, if not already unchecked.
    From the menu bar, select
              Keychain Access ▹ Preferences ▹ First Aid
    If the box marked
              Keep login keychain unlocked
    is not checked, check it.
    Select
              Keychain Access ▹ Keychain First Aid
    from the menu bar and repair the keychain.
    From the Category list in the lower left corner of the window, select My Certificates. Look carefully at the list of certificates in the right side of the window. If any of them is marked with a red "X" as expired or invalid, delete it. Also delete all items with "iMessage" or "com.apple.idms" in the name, whether valid or not.
    From the menu bar, select
              Keychain Access ▹ Preferences... ▹ Certificates
    There are three menus in the window. Change the selection in the top two to Best attempt, and in the bottom one to  CRL.
    Log out and log back in.
    Step 2
    Hold down the option key and select
              Go ▹ Library
    from the Finder menu bar. Move the following items from the Library folder to the Trash (some may not exist):
              Containers/com.apple.corerecents.recentsd
              Caches/com.apple.Messages
              Caches/com.apple.imfoundation.IMRemoteURLConnectionAgent
              Containers/com.apple.iChat
              Containers/com.apple.soagent
              IdentityServices
    Leave the Library folder open. Log out and log back in.
    Step 3
    Go back to the Finder and move the following item from the open Library folder to the Desktop:
              Messages
    Note: you are not moving the Messages application. You’re moving a folder named “Messages.”
    If Messages now works, delete the Messages folder on the Desktop. Otherwise, quit Messages again. Put back the folder you moved, overwriting the newer one that may have been created in its place.
    Step 4
    In the Preferences subfolder, there may be several files having names that begin with any of the following strings:
              com.apple.iChat
              com.apple.ids
              com.apple.imdsmsrecordstore
              com.apple.imessage
              com.apple.imservice
    Move them all to the Desktop. There may also be a file with the name "com.apple.imagent.plist". Move that to the Trash.
    Also in the Preferences folder, there's a subfolder named "ByHost". Open it and do the same thing.
    Log out and log back in. Test again. This time Messages should perform normally, but your settings will be lost. You may be able to put back some of the files you moved to the Desktop in this step. Relaunch and test after each one. Eventually you should find one or more that causes Messages to malfunction. Delete those files and recreate whatever settings they contained.
    If the issue is still not resolved, quit Messages again and put all the items you moved to the Desktop back where they were. You don’t need to replace the items you moved to the Trash. Stop here and post your results.
    If you later decide that you don’t like the results of Steps 3 and 4, you can undo them completely by quitting Messages and restoring the items you deleted in those steps from your backup.

  • Uploading data simultaneously in sql server 2008

    Hi All,
    I have a scenario like multiple users loading different data into a tool.Till now my scripts were allowing 1 user to load a data at a time. Now it should allow many users to upload their data simultaneously(or atleast the illusion that the data is being
    uploaded at the same time).
    IF tables are being locked during an import then as soon as the table is unlocked user 2's data should start processing.
    If table locking must occur, l should lock the table until that table is finished being updated. This is the case,First user loads XL spreadsheet which has data into the tool. once it is loaded and import is clicked , In database first 
    Assetstaging -------->Centerlinestaging------->Misc_asset are populated these are the main tables which populates first. Then my procedures get executed. At this point i should restrict ,i.e User1 loads the data main table populates,at same time user
    2 loads data ,So how will i handle this kind of scenario? I got a hint using locking concept i should do, I am not aware about that..is there any way i can do please help me.I am new to to this.
    Deepa

    1. First application accepts an XL spreadsheet which has a bulk data
    2. Once import is done Staging tables are loaded first. Till now only one user was able to load the data. Now requirement is like multiple users should load different data. I should lock at staging tables. 
    I dont have any idea about locking concept. How can i lock the staging table? what should i do when other users are also loading data at same time?
    Below is the staging table structure
    CREATE TABLE dbo.Misc_AssetTypeStaging
        Point                 int                NULL,
    Misc_AssetType        varchar(100)       NULL,
    BeginMilepostPrefix   varchar(5)         NULL,
    BeginMilepostSuffix   varchar(5)         NULL,
    BeginMilepost         decimal(15, 8)     NULL,
    BeginTrackName        varchar(20)        NULL,
    BeginLatitude         decimal(15, 8)     NULL,
    BeginLongitude        decimal(15, 8)     NULL,
    BeginElevation        decimal(15, 8)     NULL,
    EndLatitude           decimal(15, 8)     NULL,
    EndLongitude          decimal(15, 8)     NULL,
    EndElevation          decimal(15, 8)     NULL,
    EndMilepostPrefix     varchar(5)         NULL,
    EndMilepostSuffix     varchar(5)         NULL,
    EndMilepost           decimal(15, 8)     NULL,
    EndTrackName          varchar(20)        NULL,
    SubdivisionName        varchar(20)       NULL,
    Direction             varchar(16)        NULL,
        Speed                 int                NULL,
    TrainType             varchar(20)        NULL,
    Operator              varchar(2)         NULL,
    QualifierType         varchar(15)        NULL,
    RestrictionParameter  int                NULL,
    RestrictionType       varchar(20)        NULL,
    FBARDirection        varchar(16)        NULL,
    SignalAuthorityType  varchar(16)        NULL,
    YardLimits           varchar(1)         NULL,
    CabSignalType        varchar(16)        NULL,
    PTCType              varchar(15)        NULL
    Please help me.Thanks in advance
    Deepa

Maybe you are looking for