Optimal way to retrieve data from a linked server?

Hi,
If I create a view for our "Support Calls" list inside our database the SQL code looks like this...
Code Snippet
SELECT CALL.REFERENCE AS CallRef,
 CALL.CUSTOMERREF AS CustomerRef,
 CUSTOMER.NAME,
 DATEADD(hh,CALL.OPENHRS, DATEADD(n, CALL.OPENMINS, CALL.OPENDATE)) AS Opened,
 DATEADD(hh, CALL.CLOSEHRS, DATEADD(n, CALL.CLOSEMINS, CALL.CLOSEDATE)) AS Closed,
 DATEADD(hh, CALL.ACTHRS, DATEADD(n, CALL.ACTMINS, CALL.ACTDATE)) AS Actioned,
 CALL.PRODUCTREF,
 SUPPROD.NAME AS ProductName,
 CODES_2.CATEGORY AS CallType,
 REPLACE(CODES_3.CATEGORY, '£ ', '') AS CallStatus,
 CODES_4.CATEGORY AS CallPriority,
 CALL.TITLE,
        CALL.CALLER,
 CALL.HANDLERTAG,
 CODES_1.CATEGORY AS SLA,
        CODES.CATEGORY AS ActionCategory,
 CALL.szemail,
 CALL.szphone,
 CALL.szline,
        CALL.szresolvedby
FROM    EVENT
INNER JOIN
 CODES ON CALL.ACT = CODES.NO INNER JOIN
        CODES AS CODES_1 ON CALL.CATAREA = CODES_1.NO INNER JOIN
        CODES AS CODES_2 ON CALL.CATTYPE = CODES_2.NO INNER JOIN
        CODES AS CODES_3 ON CALL.CATSTATUS = CODES_3.NO INNER JOIN
        CODES AS CODES_4 ON CALL.CATPRIORITY = CODES_4.NO INNER JOIN
        SUPCUST ON CALL.CUSTOMERREF = CUSTOMER.REFERENCE INNER JOIN
        SUPPROD ON CALL.PRODUCTREF = SUPPROD.REFERENCE
Support calls that are closed are simply moved from the CALL table, to a table called ARCHIVED_CALL which is identical in structure.
So, if I want a single view to present all support calls, the query string would be twice as long as the one above unless I create two views (one for each database) and use a third view to UNION them.
Thing is, I can't create the views inside the enterprise database (political reasons); I have to do it from another server.
The enterprise system is on a quad core server on the same gigabit switch as the dual core server hosting the SQL instance that is retrieving the data.
I tried creating a view based on an openquery statement e.g.
Code Snippet
SELECT * FROM OPENQUERY([ENTERPRISE SERVER],
        'SELECT ..... FROM CALL UNION ALL SELECT ..... FROM ARCHIVED_CALL')
Can't say I'm impressed. The returned dataset has under 4000 records in it, but it takes more than 15 seconds to execute the query.
This is by far the smallest dataset that we need to work with - the support call notes tables (live and archived) contain over 60,000 records in total. I can boil the kettle, make a pot of tea, leave it to brew and then pour when ready, before the view finishes doing its job!
I tried using SPs to populate a local table with the data returned by the OPENQUERY, but this turned out to be a real headache when handling situations like users updating or archiving support calls; the only way that seemed to work was by dropping all records and then reimporting them and that didn't seem to be any faster.
Any ideas?

Hi,
Sorry for the delay in getting back to you all. I've got a bit of expanded info for you which'll probably help you understand the situation better.
We have two databases, call 'em Support and Sales for the sake of argument, and they format data differently so I have a proof-of-concept SP which gets just the customer names and references from each table, then creates a temp table formatted as follows:
Customer ------- Support Reference - Sales Reference
ABC SITE1        ABC                 ABC1
ABC SITE2        ABC                 ABC2
ABD CUSTOMER                         ABD1     
BBB SUPPORTONLY  BBB  
So in Sharepoint, for example, someone does a customer name search and they will get a list of customers who fit the bill, along with links to the various customer records.
And the code I'm predominately concerned with, is this bit of it:
Code Snippet
create table #SupportIDs
[Customer Name] varchar(120),
[Support Reference] varchar(16)
create table #SalesIDs
[Customer Name] varchar(120),
[Sales Reference] varchar(16)
INSERT INTO #SupportIDs
    SELECT [Customer Name], [Support Reference] FROM  
    OPENQUERY([SUPPORTSERVER],        'SELECT NAME AS [Customer Name],
                                REFERENCE AS [Support Reference]
                                FROM Support.CUSTOMERS')
INSERT INTO #SalesIDs
    SELECT [Customer Name],
        [Sales Reference] FROM  
    OPENQUERY([SALESSERVER], 'SELECT name as [Customer Name], customer as [Sales Reference]
FROM         Sales.CUSTOMERLIST')
SELECT dbo.Neaten([Customer Name]),
   dbo.Neaten([Support Reference]),
   '' AS [Sales Reference]
FROM #SupportIDs
UNION ALL
SELECT dbo.Neaten([Customer Name]),
   '' AS [Support Reference],
   dbo.Neaten([Sales Reference]) FROM #SalesIDs
// dbo.Neaten performs left & right trim, strips out illegal characters, and then converts to uppercase.
It takes no time at all to drag the data into #SupportIDs (<1 second), but it takes >10 seconds to do the same with the data from #SalesIDs, purely because the Sales database is hosted on a SQL 2000 instance on an old server the other side of a slow WAN link from here.
In total, there are less than 2750 records returned from the SP in the UNION statement, 2100 of which are coming from the #SalesIDs temp table.
The function Neaten just strips out white space and capitalises the value.
If I can store this dataset in a local table, and have a trigger on the SQL instance which refreshes the table once a day, then I think we could probably live with it.
The ADF for BDC would only need to point to the local table if that were the case.

Similar Messages

  • What are the different ways of retrieving data from Oracle8i

    What are the different ways of retrieving data from Oracle8i
    into my HTML page ?
    Is it JDBC and ODBC ?
    Is there any other way ?
    null

    Methods I tried,
    Applet using SQLJ/JDBC with JDBC drivers thin or Oci8,
    Oracle Web Publishing Assistant,
    HTP/HTF PL/SQL packages (if you have OAS 4.0)
    Webserver Generator of Designer 2000 (if you have OAS 4.0)
    Arun (guest) wrote:
    : What are the different ways of retrieving data from Oracle8i
    : into my HTML page ?
    : Is it JDBC and ODBC ?
    : Is there any other way ?
    null

  • Is there a way to retrieve data from a water damaged ipod?

    my ipod got water on the inside, and it wont charge. when i plug it in, the image shows it as charging but its not. im guessing that there is a short circuit, do to he water. is there a way to retrieve data from my ipod?

    http://www.google.com/search?client=safari&rls=en&q=svae+data+from+water+damaged +iphone&ie=UTF-8&oe=UTF-8#hl=en&client=safari&rls=en&sa=X&ei=Wwy6TtCXG-n22gX-6t2 8Bw&ved=0CCEQvwUoAQ&q=save+data+from+water+damaged+iphone&spell=1&bav=on.2,or.r_ gc.r_pw.,cf.osb&fp=bd3772843da9910d&biw=1074&bih=704
    Basic troubleshooting steps  
    17" 2.2GHz i7 Quad-Core MacBook Pro  8G RAM  750G HD + OCZ Vertex 3 SSD Boot HD 
    Got problems with your Apple iDevice-like iPhone, iPad or iPod touch? Try Troubleshooting 101
     In Memory of Steve Jobs 

  • Error retrieving data from the web server in Excel fo BPC

    Hello Everybody,
    I'm working with BPC v7.5 , i created some reports with the EVDRE formula and they were working perfectly.
    The problem started when i created new users, that in fact have the same access profile and task profile as my user.
    i started to test these new users in excel and every time i expand the report this legend appears: " EVDRE Retrying... EVDRE encountered an error retrieving data from the Web Server. Retrying in (X) Seconds...". After waiting a while a push cancel, then appears a window with the legend: Ev4excel Addin, Errors found retriening data.
    The funny thing is that when i login back to my user everything works fine again, any idea what could be the problem? the other user have the same permissions.
    Thanks a lot in advance!!
    Nidia Olguí

    very strange. Normally the member access profile must be diifferent. So it is not important the task profile but the member access profile. Can you please double check ?
    If you are doing a simple EVDRE with users having problems is it working or you still have problems?
    Regards
    Sorin Radulescu

  • EVDRE encountered an error retrieving data from the Web Server

    Hi,
    I'm working on a presales AppSet "Demo5b".
    When I create a brand-new EVDRE report on FINANCE app, there is no problem.
    However, after changing to ICMATCHING app, when I type =EVDRE() on a blank sheet and press Refresh, the following message pops up.
    EVDRE encountered an error retrieving data from the Web Server
    Retrying in (??) seconds
    Any idea why this happens and how it can be solved?
    Thanks!
    Sunny

    Hi Joost,
    I have the same problem. When I try to retrieve data on an input schedule is launched that error.
    I am working on an VM on MS BPC.
    I am not working with cubes so the solution is not the same.
    If i process all my dimensions this error does not appear any more?
    Best regards,
    Vitor

  • API to retrieve data from SAP content server

    Is there an API available to retrieve data from SAP content server?

    Hi
    you could check out function groups starting with OPT.
    F.eks. OPTB, OPTC, OPTD
    Also check function group ARCHIVOBJECT.
    best regards
    Thomas Madsen Nielsen

  • Best way to retrieve data from oracle?

    Hi,
    I have a few questions.
    1.)Can a rowtype or a table type returned from oracle database can be retrieved as a dataset or datareader?
    2.)Cursors generally slow down your db(Iam from microsoft sql server back ground). But we seem to be using ref cursors quite a lot here.The only way to return a result as far as i have seen in oracle is to use a ref cursor.Is there any other way?

    Hello,
    1.)Can a rowtype or a table type returned from oracle database can be retrieved as a dataset or datareader?
    I'm not sure how complex your "table types" are -- do you mean PL/SQL Associative Arrays (formerly knowns as "index-by" tables)?
    I believe that %rowtype is a PL/SQL'ism that does not work outside of PL/SQL.
    However, the 11g version of the provider introduced User Defined Types (UDTs) which may be helpful depending on your requirements, etc.
    2.)Cursors generally slow down your db(Iam from microsoft sql server back ground). But we seem to be using ref cursors quite a lot here.The only way to return a result as far as i have seen in oracle is to use a ref cursor.Is there any other way?
    Using a ref cursor is the way to return a result set from PL/SQL to a client. If you are not using PL/SQL then you would not use a ref cursor.
    The .NET Developer Center has good information:
    http://www.oracle.com/technology/tech/dotnet/index.html
    Regards,
    Mark

  • HT201318 is there a way to retrieve data from an older icloud backup?

    need help recovering voicemail from icloud, any ideas?

    The only way to access any data from a backup is to restore the entire backup to your device.

  • Is there a way to retrieve data from database wihout using JDBC while using JPDK?

    Hi,
    I want to create a portlet using JPDK with extra render modes and edit/Edit defaults mode too. The detail and show renderer mode jsp's/servlets render data from database. Based on the personalized paramter, the data rendered in detail and show mode will be obtained from database.
    The articles in the PDK zip asks not to use JDBC for security vulnerability. Does that mean , I should not use JDBC to connect to db to get data. If not, what should I use ? How do I connect to database ? Is there any class which helps to connect to db without using JDBC ?
    thanks,
    Mainak

    I'm not sure what articles you are refering to, because there is no other way to access a database from a java program. Generally, security related docs tend to be a little paranoid (and so they should be), but you have to balance high security against getting the job done.
    Obviously, if using JDBC, you need to be careful about protecting your config files because they will contain connection information.

  • Is there any way to retrieve Data from permanently crashed Palm?

    I have a treo 755p that seemed to die on me. I can't get it past the "Access" opening page when I power on.  The phone gave me a message about memory shortfall after a phone call and that was it.  My service provider -Telus- no longer handles Palm and so they quickly told me that it was toast... but I'm suspicious...  They want to get me into a Blackberry.
    I have discovered that everthing was backed up except for my Versamail and I had some important emails stored there.  Is there some way that this information can be accessed in any way?  Is there something I can try to do?  The person at the store tried to reset the phone but that apparently did not work.
    So... two parts to the the question: Can somebody tell me what steps I can do to save my Treo and if it is dead... is there any way to access the phone's hard drive?

    Hello and thank you for using the Palm Help Forums!
    I am sorry to hear about the problem you are having. Unfortunately, the device does need to be fully booted to access the memory and sync it. If it is not able to boot, there is no supported way of getting your data off of that unit. A hard reset may resolve the boot issue you are having but the data would be lost. However, you can try a hard reset and answer "No" to erasing your data to see if it will fully boot. I will epxlain this process in further detail.
    To hard reset the device you will want to remove the battery. Before placing the battery back in the device, hold down the red (end call) button. While holding down that button reinsert the battery. Continue holding the red button until the loading bar at the bottom completes. You will then be prompted with a message "Erase All Data Yes or No." You will then press DOWN on the 5 way navigator to respond "No" to this prompt. If the device still gets stuck and will not boot then you must answer "Yes" to resolve the issue. NOTE: BY ANSWERING YES WILL ERASE ALL DATA CURRENTLY STORED ON THE DEVICE.
    I hope this helps in resolving the issue you are having. Future advice: Hotsync your device to a computer regularly to keep a back up of your data just incase if these problems occur.

  • Best way to Import Data from a SQL Server Table?

    Hi,
    Firstly thanks for looking at this question.
    We need to import data into SAP BPC 5.1 on a twice daily basis and have chosen not to export to a .CSV file but instead to hold all data in a SQL table and import it directly from there.  As part of the import we wish to run the default logic, however only over the data which is imported as opposed to having to running default logic over the entire database after every import.
    We did some research on this topic and the only thing we could find that would work as described above is using the "Import SQL" package.  However we keep experiencing problems with it and have not yet been able to run it successfully; the errors it gives are not consistent from run to run which makes it difficult to start a thread, though we are getting help from the helpdesk at the moment.
    My question here though is - is there another way that someone knows of to import data into SAP BPC from a SQL table, and being able to run default logic over just the data being imported, or is our only hope getting the "Import SQL" package working?
    Any help much appreciated.
    Regards,
    Iain
    Forgot to mention details of our environment:
    SAP BPC v5.0.495, 2 server environment -
    Server 1 (DB/AS/SSIS/File server) = 64bit Windows 2k3 server with 64bit SQL Server Enterprise Edition
    Server 2 (IIS/App server) = 32bit Windows 2k3 server
    Edited by: Iain Hambleton on Jun 17, 2008 3:25 PM

    Lain,
    I recently created SSIS packages that need to work with a staging table that does all kind of manipulations of that data before it is loading into SAP BPC, because it also has to load the data in the drillthrough table within the same package. From one point in my package the data is also in a SQL table so basically the same as in your situation. This also works with an export to CSV within the DTSX file like Alwin said, because in this case you can use the standard transformation and conversion stuff during the load.
    I also needed to limit the data region for logic to the data region that is in the load for currency conversion purposes. This is not very much of a problem. I had a situation where I have an Accounts receivable cube containing a daily time dimension for keyduedates and a datasrc dimension containing weeks. Every week has a complete overview of the open AR items in that week and need to be converted for that week (datasrc) only and not for the whole database every time we load. But by default data would be converted based on the Keyduedates dimension while I wanted the Week dimension to be used as the data region. I solved it by using these rows in the logic:
    *Scope_by=version,Weeks
    *xdim_memberset weeks=%weeks_set%
    *xdim_memberset version = %version_set%
    I can send you the SSIS package and logic if you want. Just send me your details then.
    -Joost
    Edited by: Joost Hoppenbrouwers on Jun 17, 2008 4:25 PM

  • HT3302 is there any way to retrieve data ( photos) in particular from an IPOD TOUCH 4 if it has not been backed up??

    is there any way to retrieve data from an IPOD TOUCH 4 if the device has never been backed up to a computer??

    Only if you used PhotoStream then try getting them (photos only) from your PhotoStream. See that topic of:
    iOS: Importing personal photos and videos from iOS devices to your computer

  • How to retrieve Data from SAP BW to  SQL

    Hi All,
    i am looking for way to retrieve Data from SAP BW to SQL.
    Could you please give me some indcations or a document on how to implement it?
    Thanks in advance
    Cheers
    Gilo

    Hi,
    You need to use open hub destination. third party tool destination for SQL
    SAP BW TO SQL -- Extraction to the third-party tool can be executed as follows:
           1.      You define an open hub destination with Third-Party Tool as the destination type.
           2.      You create an RFC destination for your third-party tool and enter it in the definition of the open hub destination.
           3.      You use API RSB_API_OHS_DEST_SETPARAMS to define the parameters for the third-party tool that are required for the extraction.
           4.      You either start extraction immediately or include it in a process chain. You can also start this process chain from the third-party tool using process chain API RSPC_API_CHAIN_START. The extraction process then writes the data to a database table in the BI system.
           5.      When the extraction process is finished, the system sends a notification to the third-party tool using API RSB_API_OHS_3RDPARTY_NOTIFY.
           6.      The extracted data is read by API RSB_API_OHS_DEST_READ_DATA.
           7.      The status of the extraction is transferred to the monitor by API RSB_API_OHS_REQUEST_SETSTATUS.

  • How to retrieve data from a MSSQL?

    Dear All,
    How can I retrieve data from a MSSQL server in my custom iView which is developed by Eclipse?
    Thanks
    Sam

    Hi Sam,
    you have a bunch of possibilities... (and they do not really differ from accessing a DB from within any J2EE app).
    You can use a direct connection, setting Database, port, user, ... within your component.
    Or you can set all these things within VisualAdmin and then reference the DataSource via JNDI from within your component.
    You can directly use SQL.
    Or you can use ObjectRelationalMappers like Hibernate...
    Any more questions?
    Hope it helps
    Detlev

  • EVDRE encountered an error when retrieving data from web server

    Hi
    When I am trying to open Data Input=>Build a schedule using a dynamic template in BPC version for SAP netweaver, I am getting the below error "EVDRE encountered an error retrieving data from the Web Server". 
    I am not able to open any template, every time I am getting the same message. I have tried again after reprocessing all the dimension.
    Even I have tried in appset APSHELL also, there also I am getting the same error
    Request you to help me to resolve the above error which will allow me to proceed further.
    Thanks in Advance.
    Venkat

    Hi,
    Beside Nilanjan's solution, this error could also occur when the expansion is running more rows than the Excel limit allows (65'000 rows and 256 cols for Excel 2003)...
    Even when you're using suppress field to reduce the number of rows, the first sequence is to retrieve the complete dataset before performing any suppression. And this could of course exceed the limit sometimes.
    Hope this helps.
    Kind Regards,
    Patrick

Maybe you are looking for

  • ORA-01103: database name 'ORDB' in control file is not 'ORCL'

    hey there !! 11.2.0 win 7 pro let me tell u whole scenario for how i reach to this error - ORA-01103: database name 'ORDB' in control file is not 'ORCL' -installed new 11g ( test/ practice environment ) -by default database created 'ORCL' while insta

  • OWB 10g R2 licensing

    The FAQ, covers a lot of questions, but the one I like to know it's If I'm a database customer do not a new one, do I automatically get a license for the use of the free core. If I'm using 10G R1, 10GR2, or 9iR2, does it makes a difference from the l

  • Interactive reports link

    Hi, I made 2 IR on apex 4.2 version usin iframe. My problem is that I need to link these 2 reports now. Can you help me with this issue? Thank you

  • Can we make two shipment cost for one outbound delivery

    Hi team, Can we make two shipment cost for one outbound delivery? Need your suggesstions. Regards Venkat Ramana

  • Apple NASM replacement to official 2.05.01 release possible?!

    Hello, currently I'm doing some low-level stuff and I noticed that the nasm version supplied with OS X is rather old (0.98.40 build on feb 2008). I want to do an update to the latest version 2.05.01 but I'm not sure if I can replace the old version b