Select from a linked server fails when executed as a join to database tables

Hi
I have been using the following TSQL to update a results table for several years it is currently running on SQL Express version 11.0.2100.60 (I have successfully run this on various versions and editions from 2005 onwards)
select c.Race_id , r.Runner_id , i.Time_secs
  from CHAMPS INPUT]...Results I
  join  [dbo].[Race] c
  on rtrim(I.Race)COLLATE SQL_Latin1_General_CP1_CI_AS
  = rtrim(c.Race_name)COLLATE SQL_Latin1_General_CP1_CI_AS
  join  [dbo].[Runner] r
  on rtrim(I.[Name]) COLLATE SQL_Latin1_General_CP1_CI_AS
  = rtrim(r.First_Name)COLLATE SQL_Latin1_General_CP1_CI_AS + ' '
  + rtrim(r.Surname)COLLATE SQL_Latin1_General_CP1_CI_AS
 where i.Time_secs > 0
This worked earlier today then with no obvious change stopped working
No error is given but no rows are returned
running select * from [CHAMPS INPUT]...Results where Time_secs > 0 returns the expected rows
Any ideas where to look for the problem

Erland thanks for your reply. I have resolved the issue, it was caused by an error in updating the joined race table. I was looking for a problem with the linked server and missing the obvious.
Hi philpits,
You can try to use SQL Profiler to capture some events while run your query.
In addition, can you get expected result while run the query on remote server? Please also check your underlying tables.
Regards,
Elvis Long
TechNet Community Support

Similar Messages

  • Linked Server Failed created by DataFeed Publishing Wizard

    I have Created Linked Server by running the   DataFeed Publishing Wizard  and used Select Query from the View  in my another SSIS Package.   When i  run the SSIS Package manually it's working fine. 
    But   when running through SQL Agent Job..  linked server failed ERROR :can not fetch the rows from Linkedserver..

    Perhaps the Agent SSIS step needs to be
    executed under a proxy
    Arthur
    MyBlog
    Twitter

  • 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.

  • Dynamic link server failed

    I get a "dynamic link server server failed" error message when trying to add Premiere projects to adobe media encoder. CS6, update to date according to the adobe updater. Tried a restart, still nothing. This feature worked fine until about a week and a half ago. Wish adobe offered phone support for a $1,000  suite of software...
    Edited by: Kevin Monahan
    Reason: Please keep the title of your post short and concise for searchability purposes.

    Kyle,
    I have the same problem. All of this functionality worked before (at least about 130 days ago), but there have been at least two updates to Pr since that time.
    Here are a few more data points. (Win 7 x64 Ultimate on HP Z820 32 GB RAM, Quadro 4000 CS6 Master Collection)
    (1) Exporting using Queue in Pr CS6 to batch in AME creates the project file in a TEMP directory, and launches AME and adds the file to the Queue. When I press start, it sits a LONG time, then finally in the Encoding panel, I get the "Connecting to Dynamic Link Server...", until it fails with the error "Can't read source file..."
    (2) Exporting directly from Pr works fine (so headless AME is working)
    (3) Importing a Pr Sequence within AME does not work, I get an error from the Import Premiere Pro Sequence dialog (after a long wait “Connecting to Dynamic Link server…”) that “Connecting to Dynamic Link server failed”.
    I suspect this is a dynamic link issue, but don't know where. I've tried the 'create a new Premiere shortcut in dynamicilnk folder' solution, but it didn't work. When I first tried that, I did find two shortcuts already there, one for Pr and one for Ae, but BOTH of them pointed to a CS4 folder! I've never owned CS4, and went from CS3 Design Professional to CS6 Master Collection. I also suspect this issue was caused by one of the updates to Pr that occurred within the last 130 days (since the last time I know this functionality worked). I've made not changes to my system during that time.
    I do not use Windows Firewall, and all of this happens on a single machine, so there should be no TCP traffic across the wire (unless it is communicating with Adobe?). I use Webroot Endpoint Protection, but have received no indication that anything is suspect or has been blocked. Any help from the Adobe engineers would be greatly appreciated.

  • Connecting to dynamic link server - FAILED - second time

    I bought the creative cloud membership and I use after effects for my projects then send them over to media encoder for rendering.
    At first when I would send it over to media encoder it worked just fine, then SUDDENLY, one day, it stopped worked and it would say  "connecting to dynamic link server failed".
    I deleted the program and re installed it and it did the trick...However, AGAIN, this same problem and unexpectedly risen. I do not want to be deleting and installing every-time this happens.
    I have a brand new windows 8.1 computer and I do not know why this is happening. any fixes?

    Something is running that is preventing dynamic link from opening. It could be any one of a host of programs. Open up your Task Manager (Activity monitor if you are having the same problem and are on a Mac) and check for all running programs to see which one is hanging. Then either update or uninstall the app that is causing the problem.
    If you don't find anything there try purging memory and disk cache first and then allocate more memory to other apps in AE's preferences.

  • Import Error: Connecting to Dynamic Link Server Failed

    Just tried to import file sinto a brand new LR Catalog when I got this message...here's the entire error message:
    "An unknown error has occurred while reading the video file. Connecting to Dynamic Link server failed. (98)"
    Connecting to Dynamic Link Server Failed
    this was then followed by a list of files of these types:
    .mov
    .m4v
    .3gp

    I've read several threads about this problem (because I had it myself) and what worked was closing Lightroom, uninstalling Quicktime, restart Lightroom, ignore the "you have to have quicktime" message, and import the videos. Then I reinstalled Quicktime.
    But, I think the problem isn't quicktime itself; I think it's something to do with iTunes. During Quicktime uninstallation, it said that iTunes was open. I disagreed, but Task Manager showed the process still running. I had to kill it manually to complete the uninstall.
    So, just a thought, maybe check to be sure iTunes isn't running before trying the Lightroom import? One never knows....

  • Media Encoder & Dynamic Link Server Failed

    I want to set up a few sequences from Premiere into the Media Encoder to render overnight. Yet, everytime I try and put a sequence into the Media Encoder it just sits and the "Connecting to Dynamic Link Server..." for a few minutes until finally "Dynamic Link Server Failed" pops up.
    Anyone know how I can fix this?
    Thanks!

    I've been searching/troubleshooting for days, none of the firewall, new shortcuts in folder, antivirus, you name it I tried it even wiped my system which seemed to work at first..
    What did it for me in the end was I had Dxtory (a software recorder, for recording gameplay) running on startup, and somehow it interfered with only Premiere projects in Media Encoder, I could still import AE projects go figure.
    Check all the programs you have running or use sometimes, if they have some sort of hook into other programs/deal with video/codecs this could be your problem too!
    Thanks to everyone trying to solve this problem!
    -JonOfAllGames

  • Connecting to Dynamic Link server failed

    I am using an HP Desktop computer:
    - 24 GBs RAM
    - Quad Core i7
    - NVIDIA GTX-580 GPU
    - Windows 7 Professional
    I have Master Collection CS6 and I'm not sure if Dynamic Link ever worked properly for me. But I am experiencing 2 issues:
    1). When I use Media Encoder, I want to use "File" > "Add After Effects Composition..." or "Premiere Pro Sequence..." and can't progress further. When I try to bring in the Premiere Pro sequence, I get a loading bar, but it never loads the sequence. When I try to bring in the After Effects composition, I get the message "Connecting to the Dynamic Link server failed."
    2). When I open a squence in Premiere Pro that has a clip that is Dynamically Linked to After Effects, the clip will show in the timeline as media not found or available. I have to try and relink it to make it work. This would be a huge hassell if I have many clips that are dynamically linked.
    I have tried virus scans, reinstalling the software and checking to make sure the firewall is not blocking the Adobe protocols. Nothing seems to work. I unfortunately have never been able to use Dynamic Link until I got a computer that was speedy enough that would allow me to run Premiere and After Effects at the smae time! :-) Is anyone else having this issue and is there a solution?
    Here are some screen shots:

    I've been searching/troubleshooting for days, none of the firewall, new shortcuts in folder, antivirus, you name it I tried it even wiped my system which seemed to work at first..
    What did it for me in the end was I had Dxtory (a software recorder, for recording gameplay) running on startup, and somehow it interfered with only Premiere projects in Media Encoder, I could still import AE projects go figure.
    Check all the programs you have running or use sometimes, if they have some sort of hook into other programs/deal with video/codecs this could be your problem too!
    Thanks to everyone trying to solve this problem!
    -JonOfAllGames

  • I keep getting a " the connection to the server failed" when trying to use hotmail

    I keep getting a "The connectioin to the server failed" when trying to use hotmail

    Go into Settings, Mail, Contacts, Calendars, select the Hotmail account and check the account settings. Did you set it up with the Hotmail preset? Has this account ever worked on the iPhone? What other troubleshooting have you done?

  • HT2480 hi i am getting message that CANNOT GET MAIL  THE CONNECTION TO THE SERVER FAILED when trying to add official mail to Exchange in IPHONE 5

    hi i am getting message that CANNOT GET MAIL  THE CONNECTION TO THE SERVER FAILED when trying to add official mail to Exchange in IPHONE 5

    Talk to your IT department...
    Or if you're at University, talk to the computer team.
    Most Uni's are using outlook.com as the server connection not mail.youruniversity.edu

  • The way to open 3D pdf with specific model selection from url link

    I guess this feature is not supported, but let me ask one thing.
    I am looking for the way to open 3D pdf with specific model selection from url link.
    For example, if the following link is opened, is it possoble to open 3d.pdf with automatic selection of "abc" model in the model tree? 
    http://example.org/3d.pdf#model=abc
    If it can be done by javascript, it's really helpful.

    Impossible. There are only very limited command-line options for the Acrobat Family and you cannot change them.

  • 'dns' server failed to upgrade the Network Registrar configuration databases!!!

    I have problem with installation the Network Registrar 7.2. According to the install log: "The 'dhcp' server failed to upgrade the Network Registrar configuration databases !!! See C:\NetworkRegistrar\Local\temp/dhcp_upgrade_status_log for details." The dhcp_upgrade_status_log is not found on my PC.
    Do somebody familar with such problem?
    Thank in advance.

    Hi Dave,
    Any luck on this thread? Where you able to find a work around on this problem? I am encountering also the same problem thou my OCR and Voting Disk are on raw partition.
    I have done clean-up using the "dd" command and re-install CRS a couple of times and still with no luck...
    Hope RAC gurus can help us on this.
    Any help would be much appreciated.
    Thanks!

  • Connection to server failed when selecting continue search on server

    Hi,
    I have a client that has an Exchange 2007 server and is having problems searching emails on their iPads (and iPhones). When they search and then hit continue search on server, it will come back with a "Connection to Server Failed"
    Client claims that it "used to work"
    anything we can tweak on the ipad or server to help?
    raffi

    Jim...
    See:  Issues sending or receiving mail on iPhone, iPad, or iPod touch > iCloud: Troubleshooting iCloud Mail

  • Server fails when installed the Oracle Developper Suite 10 g

    Hi all,
    I am facing a problem which is that the server fails to connect after I istalled the Oracle Developper Suite 10 g. I am using Oracle 10g for vista and I followed exactly the instructions that were posted before.
    I typed in the command prompt 'tnsping <my_database_name>', and I got the follwinf error: TNS-03505: Failed to Resolve Name.
    When I deinstalled the Oracle Developper Suite, I could easily get connected after typing the same instructions.
    Thanks in advance
    Michael

    The server does not work once the Oracle Development
    Suite is installed. When I deinstall this Oracle
    Development Suite, the server starts working again. I
    mean by "server fails to connect" that when I type in
    the command prompt 'tnsping <my_database_name>' the
    operation fails. I do not mean that the client fails
    to connect to the server, of course the connection
    between the client and server could not be
    established as the server is already down.Hi Michael,
    On Windows each new Oracle install puts itself at the front of the system path, i.e. assuming that you want to use the new environment by default. You can correct this either by editing the path manually or else by firing up the Universal Installer, selecting the "Installed Products" button and then clicking the environment tab.
    Name resolution is (ignoring fancy things like directory service support etc) done by each Oracle Home by first examining the contents of the network configuration files in a directory pointed to by the TNS_ADMIN environment variable, then by examining the files in the %ORACLE_HOME%\NETWORK\ADMIN directory where %ORACLE_HOME% is the oracle home for the executable being called. Thus when you've run tnsping you've picked up tnsping from the new developer suite install and it uses the files in it's oracle home to resolve the service name (and fails).
    You can correct this by
    1) setting TNS_ADMIN and maintaining files in one location.
    2) copying the network configuration files from the server oracle home to the developer suite oracle home.
    Niall Litchfield
    http://www.orawin.info/

  • Selecting from a SQL Server 2005 with long column names ( 30 chars)

    Hi,
    I was able to set up a db link from Oracle 11.2.0.1 to SQL Server 2005 using DG4ODBC.
    My problem is that some column names in the Sql Server are longer than 30 chars and trying to select them gives me the ORA-00972: identifier is too long error.
    If I omit these columns the select succeeds.
    I know I can create a view in the sql server and query it instead of the original table, but I was wondering if there's a way to overcome it with sql.
    My select looks like this:
    select "good_column_name" from sometable@sqlserver_dblink -- this works
    select "good_column_name","very_long_column_name>30 chars" from sometable@sqlserver_dblink -- ORA-00972Thanks

    I tried creating a view with shorter column names but selecting from the view still returns an error.
    create view v_Boards as (select [9650_BoardId] as BoardId, [9651_BoardType] as BoardType, [9652_HardwareVendor] as
    HardwareVendor, [9653_BoardVersion] as BoardVersion, [9654_BoardName] as BoardName, [9655_BoardDescription] as BoardDescription,
    [9656_SlotNumber] as SlotNumber, [9670_SegmentId] as SegmentId, [MasterID] as MasterID, [9657_BoardHostName] as BoardHostName,
    [9658_BoardManagementUsername] as BoardManagementUsername, [9659_BoardManagementPassword] as BoardManagementPassword,
    [9660_BoardManagementVirtualAddress] as BoardManagementVirtualAddress, [9661_BoardManagementTelnetLoginPrompt] as
    MANAGEMENTTELNETLOGINPROMPT, [9662_BoardManagementTelnetPasswordPrompt] as MANAGEMENTTELNETPASSPROMPT,
    [9663_BoardManagementTelnetCommandPrompt] as MANAGEMENTTELNETCOMMANDPROMPT FROM Boards)performing a select * from this view in sqlserver works and show the short column names
    this is the error i'm getting for performing a select * from v_boards@sqlserver_dblink
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Microsoft][SQL Native Client][SQL Server]Invalid column name 'BoardManagementTelnetLoginProm'. {42S22,NativeErr = 207}[Microsoft]
    [SQL Native Client][SQL Server]Invalid column name 'BoardManagementTelnetPasswordP'. {42S22,NativeErr = 207}[Microsoft][SQL Native
    Client][SQL Server]Invalid column name 'BoardManagementTelnetCommandPr'. {42S22,NativeErr = 207}[Microsoft][SQL Native Client][SQL
    Server]Statement(s) could not be prepared. {42000,NativeErr = 8180}
    ORA-02063: preceding 2 lines from sqlserver_dblinkI also tried replacing the * with specific column names but it fails on the columns that have a long name (it doesn't recognize the short names from the view)
    what am I doing wrong?
    Edited by: Pyrocks on Dec 22, 2010 3:58 PM

Maybe you are looking for