Detect in memory record link to table

Hello,
I recently was given an old project that now runs on .NET v3.5 with LINQ to SQL. I found that in the business logic layer, the previous authors frequently attempt to join in-memory "array of class" to SQL table directly, result in extremely slow
query as some of our customers has grow the database big with 10+ years of data.
I'm able to either push the entire logic to pure table join or pure in-memory join to workaround this, but want to know that is there any tools available that can help me check the whole project and pick these "array of class"  to SQL table
queries out to fix.
Thank you.

Hello,
Personally, I do know there would be such a tool could be so smart to check if the query is a in memory join one. If these queries are similar with below one:
var result = (from od in ods
join o in db.Orders on od.OrderID equals o.OrderID
where od.OrderDetailID == 1
select o).ToList();
My idea is to search the whole project by the key word “from” and check these queries if there are local array object. If the project is huge, this might take some time. And if you find such a tool, it is suggested that you could share it to this forum which
would be helpful to others.
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Is there any way to detect commited deleted record in a table?

    Hi All,
    Is there any way to find out commited deleted record in a table without using triggers?
    Thanks,

    If you want to get back the deleted records and you are using 10g or above than Flashback technology can get that for you.
    If you want to find out the commands that did the work and you are not using 10g than as suggested, Auditing and LogMiner can be the option.
    Aman....

  • How to create a record link in pivot table?

    Hi,
    I have records in pivot table.
    I want to have ActionLink on the record, ex., i have lead record clicking on first name or last name or lead id it should take to me to the detail lead page(from pivot table).
    Regards,
    -Venkat.

    To achieve this, use the following:
    In column properties, choose data format tab.
    Override the default data format, Treat Text as Custom Text Format.
    Paste the following into the format box:
    @[html]<a href="/OnDemand/user/LeadsDetailPage?OMTGT=LeadDetailForm&LeadDetailForm.Id="@ target="_parent">"Lead Details"<a/>
    Good Luck.
    Edited by: Thom L on Apr 17, 2009 10:16 AM

  • How to delete the Table Contents before inserting records into SQL table ?

    Hello Experts,
            I have a scenario where in I have to Pick up some records from SAP RFC & insert into SQL table.
            i know how to do this scenario but the proble with this is before inserting we first have to ZAP the SQL table & insert a new records. One more twist is The Triggering is happening from SAP side with Sender RFC. If this would have been from SQL Side i could have written a Stored Procedure/ Trigger & could have called this before the SENDER JDBC communciation channel picks up the Triggering event from SQL side.
    So how to do this scenarioin XI, First deleting all the Records of SQL table & then inserting the new reocrds. without using the BPM.
    Regards,
    Umesh

    hi umesh,
    you can achieve this by writing SQL query in message mapping level..
    refer this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/b0/676b3c255b1475e10000000a114084/frameset.htm
    regards.

  • How to delete the duplicate records in a table without promary key

    I have a table that contains around 1 million records and there is no promary key or auto number coulums. I need to delete the duplicate records from this table. what is the simple effective way to do this.

    Please see this link:
    Remove duplicate records ...
    sqldevelop.wordpress.com

  • How to update Records of SAP table from .CSV file

    Hi,
    I have written a code which takes a data from (,) delimited CSV file and adds it into the Internal table.
    Now I want to update the all fields in SAP table with the Internal table.
    I want to use Update statement.
    Update <table Name> SET <field needs to update> WHERE connditon.
    I don't want to iterate through thousand on record in sap table to check the where condition.
    Could you please tell me how to do it.

    Hi. I thing you will not workaround the iterating of the internal table.
    You can pre-load all the records into another internal table
    check lt_csv[] is not initial. " important, otherwise next select would read all records of the table
    select .... into lt_dbitab for all entries in lt_csv where key-fieds = lt_csv-key_fields...
    check sy-subrc eq 0 and lt_dbitab[] is not initial.
    then do in-memory update of the it_dbitab
    loop at it_dbitab assign <fs>.
      read table lt_csv assign <fs_csv> with key ... " lt_csv should be sorted table with key, or you should try to use binary search
      if sy-subrc eq 0.
        ...change required lt_dbitab fields: <fs>-comp = <fs_csv>-comp...
      endif.
    endloop.
    ant then you can do mass-update
    update dbtab from table lt_dbitab.
    From performance view, this solution should be much faster than iterating lt_csv directly and updating every single database record
    Br
    Bohuslav

  • Issue with fetching a record from IHPA table with PARNR value as condition

    Hi All,
    I am trying to fetch a particular record from IHPA table where i am giving the OBJNR number, PARVW and PARNR as customer no. , But I am not getting any record  but if i will give OBJNR and PARVW it will generate a record with having same PARNR value.
    Example :
    case 1st :-
    when i am passing following values in IHPA table,
    OBJNR  = IE000000000010070910
    PRAVW = BP                 
    PARNR  = 620000562   
    it is not generating any record  
    case 2nd:-
    But if i will pass  
    OBJNR  = IE000000000010070910
    PRAVW = BP
    it will generate a record?(one row) which will include PARNR as same 620000562 along with other value.
    Q1 -  Why it's not generating in case 1st,
    Q2 - How I will resolve this issue ? as i have to link some table as EQUI -
    IHPA -
    VCKUN
    VCNUM ?
          I have written a code for this to join :
         SELECT A~EQUNR
           B~PARVW
           C~CCNUM
           D~CCNUM
           FROM EQUI AS A JOIN IHPA AS B ON AOBJNR = BOBJNR
           INNER JOIN VCKUN AS C ON BPARNR = CKUNNR
           INNER JOIN VCNUM AS D ON CCCNUM = DCCNUM
           APPENDING CORRESPONDING FIELDS OF TABLE IT_OBSO
           WHERE A~EQUNR IN S_EQN.
                 AND PARVW  = 'BP'.
          But it is not generating any record but when i am commenting the PARVW i am getting the mixed record of PARVW as (BP,SP,SH)
    Let me know if any more clarification required.
    Highly appreciate your help
    Thanks & Regards
    Shaw

    Hi Santosh,
    Thanks for your quick response.
    But I am Sorry, I already checked with putting Zero before PARNR.
    The issue is still as it is.
    Thanks
    Shaw

  • Need assistance searching records from multiple tables - Please Help!

    Hi, I've been trying to solve this problem for several weeks now, and I have exhausted all of my knowledge and experience.  I need help, and I hope someone here can give me some direction.
    I am using VB 2008, and the CR that comes bundled with VS 2008 Pro.  My database is a SQL Server 2005 CE v3.5 (a *.sdf file).  I am connecting to the database through a dataset, and I am displaying the report in a CrystalReportViewer.
    My dataset consistes of two tables:
    1) tblCustomers which has a primary key "CustID", and contains only customer contact and personal information. 
    2) tblDateVisited which has a primary key of "VisitID", but it also has a column titled "CustID". Basically, every time a customer visits the business, details of that visit are recorded in tblDateVisited, and that record is associated with the customer by their CustID.
    Here's what I'm trying to accomplish:  I want to be able to display only Customer records when the customer has visited and that visit matches certain criteria.  Right now, I am trying to match visits from the "tblVisitDate.PlayerType" column.  If the customer has ever had a visit where they matched a particular player type, I want to see those customer records.
    I don't know what I'm doing wrong, though.  I can search a dataset if I am only querying one table and pulling records from that table.  However, whenever I try to add a second table and perform queries on that table to get records from the first table, I can't return any records. 
    If it helps, I am trying to use one CrystalReportViewer to display multiple reports (user choice) and here's how I'm loading the report into the viewer:
    Me.tblCustomersTableAdapter.Fill(Me.dsPlayerTypeReports.tblCustomers)
    Me.tblDateVisitedTableAdapter.Fill(Me.dsPlayerTypeReports.tblDateVisited)
    Me.ReportFile.SetDataSource(dsPlayerTypeReports.Tables(1))
    I am suspicious that my problem is in the Tables(1) method.  It confuses me that I can only assign one table as a datasource when I obviously need access to two tables to make this selection work. 
    Whatever the case, I'm at the end of my rope with this one.  I'm not prone to giving up, but I'm at a dead end currently. 
    Any attempt to assist me with this will be greatly appreciated, successful or not.
    Thanks in advance!
    -Will

    No, I am connected via ADO.NET.  I don't think SQL CE can connect through ODBC (or if it can, I haven't been able to figure out how, yet).  So this isn't a stored procedure.
    When I examine the link, I can only choose an Inner Join or a Left Outer Join.  Right Outer and Full Outer are not available.  Could this be a problem with the dataset I'm using?
    Could you explain what you mean by display all of the records and then choose the selection criteria?

  • Extracting Records from multiple tables

    hi
    I have to extract almost 1 lack  records from 3 tables.
    Please help me in ABAP CODE.
    PLease it is very urgent.

    Which tables are they ?  Refer to link below for more hints abt performance.
    Re: select query - optimization

  • How to exclude records from one table that is contained in a second table

    I am trying to create a Crystal report that excludes records from one Table that is contained in a second table using the != link option and it is not working. I've tried all of the different enforce options, and it is still not excluding those records. Does anyone have any suggestions of what I'm doing wrong or any other suggestions how I can obtain the results I need?
    Thanks in advance!

    Have you tried by Command ?
    Thanks,
    Gordon

  • RFC function to return number of records in a table

    Hello,
    I am looking for a RFC function to return just the number of records in a SAP table.
    I don't want to use RFC_READ_TABLE since it takes too long when I query a big table.
    Any advices?

    Check the following post: Link: [Re: RFC function module to count records in DB table;

  • Using Crystal 2008 to insert records into a table

    Hi,
    We have a unique need to use Crystal to insert records into a table. We have managed to test a report that can write into a temporary table.  This is done by using sql command object  and uses  the following code :
    INSERT INTO TEMP_TABLE  (ORDERID)
    VALUES ({?orderid})   (-- where orderid a parameter).
    This test report asks for an order id and then inserts the record perfectly fine.
    Now moving on to the real report - This report basically prints orders in batches and we want to insert order id into a temporary table to ensure we don't print orders that were already printed. To do this we created a sub report "insert orders" that has the above insert command. The main report passes the orderid to subreport and the idea is that the subreport would insert each time an order is passed. So if main report printed 50 orders ids, the then it would do 50 inserts individually into the temp table. 
    This however is NOT working. The report runs fine but there is no insert.  Our hunch is that  Crystal is not committing after every order id is passed from the main report.  Not sure if we can set the AUTO COMMIT ON  as a default somewhere?
    Wondering if any one has attempted this or has any insights?
    Regards,
    Mohit.
    Environment is - Crystal 2008 and Oracle 11GR2, we are using Oracle drivers (and not odbc)

    Hmmm... I don't use Oracle but the syntax looks good...
    You've already tested it and I assume that you are using the same driver in the production report as you used in the test, so that shouldn't be an issue...
    how are you pulling the data? Is the final SELECT statement that pulls the report data in the same command as the INSERT script, or is the INSERT script in it's own command?
    The reason I ask... If you are trying to pass a multi-valued parameter to a command, it won't work. If you have the insert command as it's own command while the data is being pulled with linked tables or a separate command, it is possible that the report itself will execute as expected w/o passing a value to the insert script.
    If it's all in 1 command (as it should be), a bad parameter would fail in the final SELECT causing an error.
    Also... are rows null or empty string values being added to table when the report executes? This would be an indication that the command is being executed but isn't getting the parameter value.
    Jason

  • Duplicate records in a table

    i need to find duplicate records in a table that have the same name but a different id number.
    only fields i am using is the id, first name, last name, middle name
    any help would be great
    thanks

    Well, to just find the duplicate names, you can:
    select first_name, middle_name, last_name, count(*)
      from t
    group by first_name, middle_name, last_name
    having count(*) > 1;If you want to find the ids that are linked to these dupes, then:
    select *
      from t
    where (first_name, middle_name, last_name) in
       (select first_name, middle_name, last_name
          from t
         group by first_name, middle_name, last_name
        having count(*) > 1);

  • Limiting duplicate records in secondary tables?

    I have a report in CR2010 that links multiple tables. One of the linked tables has a many-to-one relationship with the primary table. I need a way to say, in effect, "Only the record with the latest date from the secondary table", thus pruning the earlier dated records. Con someone please provide a few pointers and/or some articles I can read to assist in this? Thanks!!
    ETA: What's happening is that, because of the multiple records associated with each primary record, I'm getting multiple identical details, with only the one field from the other table different. I need to only have ONE detail line that is limited to that latest secondary table record.

    you've got a couple of choices then...
    A > Group Selection Formula
    1) you can create a Group on the date field and have the Group for Every Day.
    2) you can then create a Maximum on the date field
    3) create a Group Selection Formula where you have = Max()
    the problem with this is that you don't limit the number of records coming back to your report...you're just hiding them
    B > Experiment with a SQL Expression to Use in Your Record Selection Filter
    please note that this is not a supported functionality of SQL Expression fields and will sometimes work and sometimes not...hopefully it will. the following uses the Orders table in the sample Xtreme database for crystal.
    1) create a new SQL Expression Field called "MaxOfMyDate"  with syntax like the following...please note that i have aliased the Orders table that is used in the main report as Orders2...this is to avoid any errors by using the SQL Expression in the Record Selection Filter
    (SELECT MAX(`Orders2`.`Order Date`) FROM `Orders` `Orders2`)
    2) now go back to your Record Selection Filter and change it to something like
    {Orders.Order Date} = {%MaxOfMyDate}
    the above, if it works off of your database, will bring back only order dates that are equal to the very latest order date.
    cheers,
    jamie

  • Trigger to keep a single record form a table to a certain status

    Hi all.
    I have a table which has a "Status" field. I'm trying to accomplish, with a trigger, that the table can only have one record with an "Active" status, so whenever and Insert or Update occurs, if the new value for the "Status" field is "Active", I should update all other records in the table to "Inactive". I've tried several approaches, and managed to make it work on Inserts, but any Updates wll give an error that says that the table is mutating. I've tried to do it on before and after trigger types, without success.
    Is there a way to do what I want with a trigger, or do necessarily I have to create an SP that needs to be called before the Insert or Update operation?

    Alternatively you can try with as follows:
    SQL> create table t as select rownum id, 'Inactive' status from dual connect by level <= 4
      2  union all select 5, 'Active' from dual
      3  /
    Table created.
    SQL>
    SQL> select * from t
      2  /
            ID STATUS
             1 Inactive
             2 Inactive
             3 Inactive
             4 Inactive
             5 Active
    SQL> create or replace trigger t_trg
      2     before insert or update
      3     on t
      4     for each row
      5  begin
      6     if (sys_context (
      7                      'userenv',
      8                      'client_info'
      9              ) != 'start transaction'
    10      or sys_context (
    11                      'userenv',
    12                      'client_info'
    13              ) is null)
    14     then
    15             dbms_application_info.set_client_info ('start transaction');
    16
    17             execute immediate 'update  t@loopback set status = ''Inactive'' where status = ''Act
    ive'' and id != :id'
    18                     using :new.id;
    19
    20             dbms_application_info.set_client_info ('end transaction');
    21     end if;
    22  end t_trg;
    23  /
    Trigger created.
    SQL>
    SQL> update t
      2     set status = 'Active'
      3   where id = 2
      4  /
    1 row updated.
    SQL>
    SQL> select * from t
      2  /
            ID STATUS
             1 Inactive
             2 Active
             3 Inactive
             4 Inactive
             5 Inactive
    SQL>
    SQL> update t
      2     set status = 'Active'
      3   where id = 4
      4  /
    1 row updated.
    SQL>
    SQL> select * from t
      2  /
            ID STATUS
             1 Inactive
             2 Inactive
             3 Inactive
             4 Active
             5 Inactive
    SQL>
    SQL> insert into t values (6, 'Active')
      2  /
    1 row created.
    SQL>
    SQL> select * from t
      2  /
            ID STATUS
             1 Inactive
             2 Inactive
             3 Inactive
             4 Inactive
             5 Inactive
             6 Active
    6 rows selected.
    SQL>All you need is the loopback trigger wich I defined as
    CREATE DATABASE LINK LOOPBACK
    USING '(description=(address=(protocol=beq)(program=/path_to_your_oracle_binary/oracle)))';

Maybe you are looking for

  • Having trouble with page numbering in Pages

    I moved a document from Word to Pages.  Now the page numbering is outside any text box, footer, table, etc., and cannot be accessed for editing.  I cannot click on it.  I tried fooling around with page number functions in Pages, and it merely adds a

  • Mail send error in Oracle UCM Test Mail/Notifications

    Hi Everyboby, I have configured workflows which need approval. While the documenr is checked in the notification should be fired to the reviewer. But the mail notification is not working. Also I have tried to login as sysadmin and tried the Administr

  • Problem in creating user defined fields

    hi,    i created nearly 25 userdefined fields. after that b1 is not allowing me to created further, I like to know any restriction is there to create or kindly give me the solution to create. Regards R.vijai

  • Dynamically change an image at runtime in Crystal Report

    Hello, I am using crystal report included in VS 2005 and want to display an image at runtime. I have tried using Picture control and OLE Object of crystal report, but did not get any success. I have googled for this and most of them are saying Right

  • MBP...slowing down?

    Last september, I bought a new MacBook Pro intel core duo, 1gb ram. I was very impressed with the computer. However, recently, Ive noticed everything is starting to slow down. Application load time is increasing, dashboard is slow. I get that rainbow