Deletion of data within the database tables

The user is trying to clean up the 2014 data within the database tables. He is running a delete function which keeps causing the log files
to exceed their limit. The tables are large and he is unable to delete the data in one command due to available size and logging. What is the best way to approach this?
Thanks,

Hi venkatesh1985,
According to your description, the user fails to delete data in tables due to the limited space of log file. Based on my research, this issue could occur when you use the delete statement(DELETE FROM ExampleTable) in a single transaction and consume all
available space on your transaction log disk.
To avoid this issue, you could use the two methods below to delete the data.
1. Use a loop combined with TOP and delete rows in smaller transactions as the following example. This method requires you to delete all the tables one by one.
SELECT 1
WHILE @@ROWCOUNT > 0
BEGIN
DELETE TOP (1000)
FROM LargeTable
END
For more information about the process, please refer to the article:
http://dbadiaries.com/how-to-delete-millions-of-rows-using-t-sql-with-reduced-impact
2. If you want to delete all the data from all tables in the specific database, you could script the entire database and all database objects. Then drop the database and recreate it using the script as the steps below.
a. In Object Explorer, expand the node for the instance containing the database to be scripted.
b. Point to Tasks, and then click Generate Scripts and click Next.
c. Select the option of 'Script the entire database and all database objects'.
d. Specify how scripts should be saved. You could save the script to a file or new query window. Click Next, then click ok.
e. Drop the database, and run the script in the query window to recreate it. For more information, please refer to the article:
http://msdn.microsoft.com/en-us/library/bb895179.aspx#Introduction
In addition, if possible, please increase the size of the log file or move the log file to a different disk with more disk space.
Regards,
Michelle Li

Similar Messages

  • Can I restore the deleted statistical data from the database tables?

    Hi all,
       I have deleted the statistical data from the database tables like(Ex: RSDDSTAT, RSDDSTATWHM,..) by mistake through RSA1> Tools> BW Statistics for Infoproviders--> Delete.
    Is there any way to restore the deleted data back? Thanks in advance.

    Now I'm really confused-
    Your first post said
    "<b>I have deleted the statistical data from the database tables like(Ex: RSDDSTAT, RSDDSTATWHM</b>,..) by mistake through RSA1> Tools> BW Statistics for Infoproviders--> Delete."
    but your last respsonse said
    "I have deleted the BW Statistics data, <b>not the actual data in RSDDSTAT tables</b> through
    RSA1 -> Tools -> BW Statistics for InfoProviders -> clicked 'Delete' bin to delete data."
    If you used the RSA1 -> Tools -> BW Statistics for InfoProviders -> clicked 'Delete' - <b>then you deleted the data from the RSDDSTAT tables</b>. This assumes you accepted the default date range that would have popped up after the clicking on the Delete button which specified to delete thru the current date.  If this is what you did, the data is gone.  Your only hope is be to recover from a DB backup.  
    The data in the RSDDSTAT tables is what is used to feed the BW Statistics cubes, generally on a daily basis.

  • How to delete entire data in the hierarchy table,?

    hi friends
    i need to delete entire data in the hierarchy table which contains parent child relationship,when i am selecting entire records and choose the option delete from the context menu, it is not deleting, and i have to delete one by one or i have delete first the child items and later parents items, it is time consuming process.
    Is there any other option to delete entire records in the hierachy table , irrespective of parent and child relationship?
    if any one have solution for my issue, please provide to me
    thanks in advance
    bharat.chinthapatla

    Hi Bharat,
      Unload the Repository and Delete the Table and fields in Hierarchy table and Recreate and reload the data.OIther wise you have to lot of manual work.
    Thanks
    Ganesh Kotti

  • Updating data in the database table

    Can any help me in the code for updating data in the database table.
    Regards,
    Rahul

    Hi Rahul,
    A slightly longer procedure that i'm adding here...
    1.) Create the component (i'm sure you have this covered)
    2.) Next on the button click that updates the database - add an action.
    3.) double click the action so that you are taken to the methods section of the view.
    4.) next you need to add the code that is required the update the database - this will be in the form of the above two posts.
    5.) compile and test the application
    Let me know in case you need further information on how to do this with a function module or something.
    Thanks.

  • How to delete entity-Data in the Database?

    Hello!
    Problem:
    I want to change the the Datatype of an attribute of an Entity-Service. Doing so and deploying the Application afterwards I get an deployment error, because of the changed Datatype.
    Undeploying the application doesn´t delete the Data of the Entities and doesn´t solve my Problem. 
    Where can I manipulate or delete the Data-Tables of my Entity-Services? I´ve applied local peristency.
    Thank you for your effort in advance.
    Jörg

    Hi Ju00F6rg ,
    Two possible ways to solve this:
    1. Check deployment exception and understand that is the cause. Typically, that's clear from exception which db table can not be updated. You can remove those entries which restrict table updating or remove whole table from DB at all.
    2. Open your CAF dictionary project and check all tables names. Then connect to your DB and execute statement
    like this for all of the tables:
    DELETE FROM <YOUR_TABLE>
    DB name you can find by openening config tool:
    \usr\sap\<instance>\JC<id>\j2ee\configtool\configtool.bat
    Click "Yes" for "Do you want to use the default DB setting?" message box. Select the "secure store" entry under "cluster-data" entry. Check the "databasename" property for
    "jdbc/pool/<instnace>/Url" entry.
    So, after that connect to this DB using according DB client and access your tables.
    Best regards,
    Aliaksei

  • Search for data within a database table

    Hi everyone :)
    I'm trying to make it so that the user can search for a record by id #. So, i made an input dialogue thing so the user can enter a record #. Basically, i want the data to appear in their textboxes based on the record # inputted by the user. My attempt is shown below, and when I run it, I get this:
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Data type mismatch in criteria expression.
    Here's my code:
    public JButton getSearch()
              if (search==null)
                   search = new JButton("Search Database");
                   search.addActionListener
                        new ActionListener()
                             public void actionPerformed(ActionEvent ae)
                                  try
                                       String str_rec =
                                            JOptionPane.showInputDialog(
                                                 getFrame(),"Enter Record No");
                                       int recNo = 0;
                                       try
                                            recNo =
                                                 Integer.parseInt(str_rec);
                                       catch (NumberFormatException nfe)
                                            return;
                                       String select = "SELECT studId,studFirstName,studLastName " +
                                       "FROM Students " +
                                       "WHERE studId = '" + recNo + "' ";
                                       Statement statement = getConnector().getConnection().createStatement();
                                       ResultSet result = statement.executeQuery(select);
                                       System.out.println(recNo);
                                       getView().getId().setText(str_rec);
                                       getView().getFirstName().setText(result.getString("studFirstName"));
                                       getView().getLastName().setText(result.getString("studLastName"));
                                  catch (Exception e)
                                       e.printStackTrace();
              return search;
         }I hope I explained everything properly. If you could please help me, I'd very much appreciate it.
    Thanks in advance! :)
    - spidey

    "WHERE studId = '" + recNo + "' ";Why are you putting quote marks around a number? What type of database column is studId? Probably a numeric type (not character), right? Quotes go around string/character stuff, not numeric stuff.

  • How to input data in a database table without knowing in advance table and column configurations

    Hi,
    I have a problem using LabVIEW for input data (manually) in a SQL database. I have about 40 tables in the database, each of them is related to a specific engine component. I need to create a user interface (maybe visualizing the table with a table control) where the users can insert data in the database table fields. Could someone give me some suggestion on how to do it?
    Using the  DB tools insert data.vi I need to know in advance the column configuration of the table, but in my database each table has its own structure! So do I have to create 40 different masks, one for every different table?
    Thanks in advance.
    Michela

    I have not actually used the LV SQL Toolkit, but I will try and offer high level ideas :-)
    when you have retrieved the construction data for a table, you should be able to use array and cluster indexing to aquire the names of the fieds, enough to create a labelled table on the LV Front panel.
    After completing a new entry you can INSERT the entry into the database using the same data.
    Is the SQL toolkit an additional purchase, or included in newer versions as standard? If you post a sample of the cluster/array that you retrieve, I could give you a sample VI to give you some pointers in creating the User Interface table 
    - Cheers, Ed

  • Using Tabstrip update the database table

    Hi Guy's,
    I created two screens(100 & 110).
    Click 1 pushbutton HRP1000 related information is displayed.
    Click 2 pushbutton it displays HRP1001 relatd information.
    worked to read the data from the Database tables and output displayed sucessfuly .   However i want to entered data in those fields wants to update to database table.
    Please friends help me how to work this senario.
    Thanks and Regards,
    Sai.

    Hi Guy's,
    To update the database records, wrote the logic in PAI
       WHEN 'SAVE'.
        INSERT HRP1001.
    INSERT INTO HRP1001  VALUES wa_P2.
    it displaying an error message " the work area wa_p2 is not long enough.
    and also i tried using it_p2
    it displaying an error message " you can't use internal table as work area".
    Please help me friends  it is very urgent.
    Thanks and Regards,
    Sai.

  • Delete duplicate entriess from the internal table its urgent pls help.

    Hi friends,
    Hope everybody is doing good,Here is m query on delete duplicate data from the intenal table.
    I have an internal table which contain data in the following format.
    Doc No Comp Cod Vendor Assignment
    1500000009 JM11 00000000
    1500000008 JM11 20070212(Repeating)
    1500000007 JM11 20070212
    1500000006 JM11 00000000
    1500000005 JM11 00000000
    1500000004 JM11 00000000(Repeating)
    1500000003 JM11 00000000 (Repeating)
    1500000002 JM11 00000000
    1500000001 JM11 20050302
    1500000000 JM11 00000000
    1500000003 JM11 10000088
    1500000001 JM11 10000088
    1500000030 JM11 10006260
    1500000010 JM11 10006269
    1500000008 JM11 10006269
    1500000006 JM11 10006269
    1500000004 JM11 10006269
    if you see the document numbers,there are some document number which are repeating here,there are some document numer which contain vendor number but not the assignments,some of the document numbers contain the assignments but not the vendors.
    If my internal table contain this kind of data with repeted document numbers than i want the document number which contains only the vendor number.
    Pls help me with the appropriate logic,its urgent.
    Thanks a lot
    mrutyun^

    Hi,
    <u><b>Deleting Adjacent Duplicate Entries</b></u>
    To delete adjacent duplicate entries use the following statement:
    DELETE ADJACENT DUPLICATE ENTRIES FROM <itab>
    [COMPARING <f1> <f2> ...
    |ALL FIELDS].
    The system deletes all adjacent duplicate entries from the internal table <itab>. Entries are
    duplicate if they fulfill one of the following compare criteria:
      Without the COMPARING addition, the contents of the key fields of the table must be
    identical in both lines.
      If you use the addition COMPARING <f1> <f2> ... the contents of the specified fields <f1>
    <f2> ... must be identical in both lines. You can also specify a field <fi> dynamically as
    the contents of a field <ni> in the form (<ni>). If <ni> is empty when the statement is
    executed, it is ignored. You can restrict the search to partial fields by
    specifying offset and length.
      If you use the addition COMPARING ALL FIELDS the contents of all fields of both lines
    must be identical.
    You can use this statement to delete all duplicate entries from an internal table if the table is
    sorted by the specified compare criterion.
    If at least one line is deleted, the system sets SY-SUBRC to 0, otherwise to 4.
    Examples
    DATA: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB LIKE HASHED TABLE OF LINE WITH UNIQUE KEY COL1.
    DO 4 TIMES.
    LINE-COL1 = SY-INDEX.
    LINE-COL2 = SY-INDEX ** 2.
    INSERT LINE INTO TABLE ITAB.
    ENDDO.
    LINE-COL1 = 1.
    DELETE TABLE ITAB: FROM LINE,
    WITH TABLE KEY COL1 = 3.
    LOOP AT ITAB INTO LINE.
    WRITE: / LINE-COL1, LINE-COL2.
    ENDLOOP.
    The output is:
    2    4
    4   16
    The program fills a hashed table with a list of square numbers. The DELETE
    statement delete the lines from the table where the key field COL1 has the contents 1 or 3.
    Regards,
    Bhaskar

  • Is it possible to delete a crucial data in the database?

    I'm in the very initial stage of learning abap/4 (self study). One doubt is screwing me seriously. Is it possible to change/delete the crucial data in the database by unknown way of witting the code? pls clarify me..

    hi
    Thorugh table maitainence generator u can delete the ztable data
    if u have the permissions like this
    DELETE FROM ztable1
    WHERE matnr = p_matnr AND
    I_date = sy-datum .
    if it is sap generated transparent table u cannot delete by delete statement
    u have to delete thorugh bapi or bdc.....that u have to give the strong reason to delete the data..................................
    by simple u cann't delete the data.................................it wants so many permissions inclueded with transparent tables.............

  • Table Maintenance Events - "Event 02 After Saving the Data in the Database"

    Hi,
    Can we identify the record marked for deletion in the "Event 02 After Saving the Data in the Database" ?
    Thanks & Regards,
    Esha Raj

    Look at online documentation :
    - [Event 02: After Saving the Data in the Database|https://help.sap.com/saphelp_nw04/helpdata/en/77/06b11859f511d2a6070000e82deaaa/frameset.htm]
    . - [Internal Table TOTAL|https://help.sap.com/saphelp_nw04/helpdata/en/77/06b11859f511d2a6070000e82deaaa/frameset.htm]
    . . - [Field Symbols <ACTION> and <ACTION_TEXT>|https://help.sap.com/saphelp_nw04/helpdata/en/77/06b11859f511d2a6070000e82deaaa/frameset.htm]
    . . . - [Constants for Field Symbols <ACTION>, <ACTION_TEXT>, <XACT> and <XACT_TEXT>|https://help.sap.com/saphelp_nw04/helpdata/en/77/06b11859f511d2a6070000e82deaaa/frameset.htm]
    Regards,
    Raymond

  • How to delete the database table

    hi all
    i want to delete the data  from the custrmize table so if u can heilp me to do that....not the internal table ..i write the code but that using that code i can delete only one raw.. but i want to delete all raw in my table..
    ZLAB_SUBMIT-SHADE = '1'.
    ZLAB_SUBMIT-SUBMIT = '1'.
    ZLAB_SUBMIT-RM = 'RINGS'.
    ZLAB_SUBMIT-REMARKS = 'Approved'.
    ZLAB_SUBMIT-AP = ''.
    ZLAB_SUBMIT-USNAM = 'INDIKAF'.
    ZLAB_SUBMIT-CPUDT = '05.10.2006'.
    ZLAB_SUBMIT-CDATE = '05.10.2006'.
    ZLAB_SUBMIT-CPUTM = '21:29:19'.
    DELETE  ZLAB_SUBMIT.
    regard
    nawa
    this is my code....

    Hi,
    data itab type standard table of zlab_submit.
    select * from zlab_summit into table itab.
    delete zlab_summit from table itab.
    Kindly reward points by clicking the star on the left of reply,if it helps.

  • 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

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Delete all the database table content

    Hello Friends,
    I have a z table with 5 fields (all the key fields) and I want to delete all the table content and load fresh content from internal table.
    I tried using syntax 'delete ztable' but sy-subrc value is coming as 4, means no table content is getting deleted.
    Please suggest me any alternative way to delete all the database table content.
    Thanks in advance,
    Shreekant

    Hi,
    try using
    delete from ztable.
    This will delete all records from your ztable. After this command u can fill your ztable from itab by the following command
    select *
    from std table
    into corresponding fields of itab.
    insert ztable from table itab.
    Hopefully this will solve your problem.
    Regards,
    Ibrar

Maybe you are looking for

  • How can I see my iphone 5 phone list on my pc and edit?

    HOW CAN I SEE MY PHONE LIST ON MY PC?

  • Use of rebates in externam service management (ESM)

    Hi , we try to set-up rebates in ESM. In the IMG, there are other condition types in ESM than in the normal purchasing When I try to create a condition type for rebates in ESM (eg similar to the A001 in normal purchasing) , I get an error. Via debugg

  • Error in concurrent

    hi, i submit conncurrent request (gather schema statiscs)it runs 12 hours and shown status completed -error.in log file it is showing the error like this......... ora-0000:normal,sussful completation ERROR #1:ERROR:while gather schema stats: object_n

  • Which function creates an activity in CRM?

    Hi, We would like to create activities in CRM through a BAPI-like function but we can't seem to find a suitable one. Do you know which function / class method is used to create new activities in CRM ? Thanks in advance, George

  • Need help with my curve 9300

    Hi When i try change my email definitions i go to "email accounts" then "Internet email account" then it says "Conecting to email settings" and it take too much time. After that says that an problem is found on concting the device to the server. What