Linked servers query

where can you see linked servers configured in our sql server instance, is there a SQL query? And will it list under which account the link has been configured?
By default can everyone make use of this linked server?
What do people setup linked servers, for what purpose do they serve?

Linked Query configuration information
http://support.microsoft.com/kb/203638/en-us
For other details and security details 
http://www.databasejournal.com/features/mssql/article.php/3691721/Setting-up-a-Linked-Server-for-a-Remote-SQL-Server-Instance.htm
Why linked Server,
remote access to the server
Query distributed query on heterogeneous data source
---Prashanth

Similar Messages

  • Union All with Linked Servers - Works until loaded on to the report server then fails.

    Hi,
    On our production server I have 2 linked servers.  One that leads to ServiceNow via ODBC and one that leads to an HP Openview database.
    Testing these linked servers works fine.  I have a query that obtains info from each source and 'union all' together.  When i run this query in SQL Server management studio it works fine and I get info from both data sources union-ed together perfectly.
    I transfer this into Visual Studio and create a report, which again runs perfectly.
    I upload this report to the report server and try to run it and get the error: 
    An error has occurred during report processing. (rsProcessingAborted)
    Query execution failed for dataset 'Dataset1'. (rsErrorExecutingCommand)
    For more information about this error navigate to the report server on the local server machine, or enable remote errors
    When I rummage through the log files for the report server, I find very little helpful errors, basically this:
    ERROR: Throwing Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: , Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Query execution failed for dataset 'Dataset1'. ---> System.Data.SqlClient.SqlException: Cannot
    execute the query.
    I did a test where I created a copy of the report and ran only he Servicenow  section of the report and it works, then ran only the HP section of the report and it works.  It seems the UNION ALL is the problem somehow. 
    Anyone have any ideas??
    Thanks
    Kirsty

    Hi Kirsty,
    As you posted, this issue is caused by the security configuration of Linked Server.
    Generally, in a domain environment, we can specify a domain account as the stored credentials for the report, and then configure the Linked Server to "Be made using the login’s current security context".
    However,if we specify a SQL Server login as the stored credentials for the report, please set the Linked Server security to "By using this security context", and then providing the necessary credentials to authenticate at the linked server.
    Please also add the Reporting Services Security role to the Linked Server Remote Server Login Mappings.
    For more information about Creating Linked Servers, please refer to
    http://msdn.microsoft.com/en-us/library/ff772782.aspx
    About Security for Linked Servers, please refer to
    http://msdn.microsoft.com/en-us/library/ms175537.aspx
    Regards,
    Swallow

  • Script out all linked servers. Is it possible?

    Hi All,
    Is there any query available for scripting out all linked servers which can be used while migrating from one sql instance to another sql instance? We have like 40 odd linked servers which has to be scripted out and moved to new server.
    We are doing migration from sql server 2008 r2 to sql 2014.
    Thanks in Advance.

    Hello,
    Try the following resource.
    http://www.sqlservercentral.com/scripts/Miscellaneous/30620/ 
    http://sev17.com/2010/07/06/scripting-linked-servers/
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • Distributed Transactions and Linked Servers

    I'm somewhat of a novice with SQL Server but I'm learning rapidly from an application I'm developing that uses SQL Server very heavily. In conjunction with the development of this application, I have 3-4 systems set up running SQL Server and I am using those
    systems to develop the database that will ultimately support the application. I decided to try to use linked servers because I am moving data back-and-forth among the different servers frequently and I ran into some consequences that I wasn't expecting.
    I was doing a simple delete query on one of the servers (Delete from TableName Where ...) and I was expecting, of course, that it would only impact the server I was running it on; however, when the query finished after running for a long time, it was apparent
    that SQL Server had automatically escalated that simple delete query into a distributed transaction and applied it to all four of the linked servers I had defined.  I was totally surprised by that and it took some time to recover the data that was inadvertently
    lost on the other servers.
    I want to ensure that this doesn't happen again without me expecting it - I think the right way to prevent this from happening is to run the following stored procedure:
    EXEC sp_serveroption 'servername', 'remote proc transaction promotion', 'false';
    Can someone please verify that this assumption is correct and will prevent SQL Server from automatically creating distributed transactions impacting multiple servers?
    Thanks,
    Chuck

    Hello,
    Based on your description, it seems that when you connect to a SQL Server database and execute a DELETE statement to delete a recode on a table, and then the same recode were delete in the linked server which has the same table.
    As pre my understand, the statement executed on one server will not  apply to the linked servers unless you specify the logic yourself in the application. For example, you use dynamic query and exec the query synchronously on  linked servers.
    What's more, did you specify replication between this linked server?
    If I have any misunderstanding, please let me know.
    Regards,
    Fanny Liu
    If you have any feedback on our support, please click here.
    Fanny Liu
    TechNet Community Support

  • SQL Server linked servers screens SSMS

    Where in SSMS can you get to the "linked server" screen for configuration details for existing linked servers, as opposed to setting up a new linked server, I want to check the security tab via the software GUI as opposed to running SQL. I cant
    see where you can see them, I know from memory when setting up a new linked server there is a "general", "security" and "server options" tabs, so I assume you can see all of those for already created linked servers.

    Check Server Objects --> Linked Servers  in SSMS object explorer.
    Kalman Toth Database & OLAP Architect
    Free T-SQL Scripts
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Linked servers to many sqlite databases

    I have around 600 sqlite databases and I have to be able to access them in sql server. I can create a linked server for anyone of these database and access data that way. But what should be the approach to be able to access the data (read-only) in all
    of these databases? Please don't suggest data copy :)

    I am sorry, I was not clear enough in my original post. 
    I have Sql Server and all 600+ sqlite databases on the same physical box. I need to be able to execute query (in SQL management studio) like this:
    select a.machine, b.*
    from machines a
    inner join MACHINEDATA...performance b on b.machineid = a.id
    In this query MACHINEDATA is the linked server that points to "performance435" sqlite database and performance is a table in "performance435" sqlite database.
    Everything works just fine, except that I have 614 of these "performanceXXX" sqlite database files and I can't create that many linked servers manually.
    So, the question is - how to arrange access to these 614 databases through SQL server management studio to be able to execute queries similar to the example above.
    Thanks.

  • Linked servers passwords

    1) once a linked server is setup between 2 SQL Servers, do users have to enter the password for the account used in the link each time they want to query the remote server, or once that trust is established is there no need for a password?
    2) And secondly, if the link is created with an account with an account with sysadmin permissions, does that mean every user essentially has sysadmin permissions over the remote server?

    Hello,
    1) No, you don't Need to enter a password again
    2) Depends on the user mapping / security settigs for the linked Server, which permissions to current user will have.
    For more details see
    Security for Linked Servers and the follow up links.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • I urgently need to find out how to apply behaviour to images in my webpage. Created with dreamweaver and linked J Query stylesheets.

    I have created a web page with a photo gallery of thumbnails that link to bigger images when you hover over them. When the bigger image opens there is an odd shape at the bottom right hand side , that when pressed, will take me back to the home page. But its not the correct sought of button or symbol. I dont know how to set this up properly. I have linked J.Query style sheets. But must have missed something. Can anyone help??? this is my first web page design. It is all done except for this.

    Very sensible advice. However, the second sentence in the following statement is incorrect:
    1.  Make sure that you have updated all recordsets to the latest (CS4) version. Older ones created before the GetSQLValueString function was introduced are vulnerable.
    The GetSQLValueString() function has always existed in Dreamweaver server behavior code. However, versions of this function prior to Dreamweaver 8.0.2 are vulnerable to SQL injection.
    Unfortunately, you can't update older server behaviors simply by deleting the old version of the function and replacing it with one from DW 8.0.2 or later. Other small changes were made in the server behavior code for compatibility with the revised function. PHP server behaviors created prior to DW 8.0.2 need to be deleted and rebuilt. Yes, it's a pain, but far less of a pain than being hacked.

  • How do make link between query and UDF

    How do you link a query to your UDF after you created the query and the UDF?
    Also do you have to set the UDF as type "general", and "link"?
    Please take me thru step?

    oh good - a discussion about whether to use "link" or "image" when having an image connected to a product!!!
    Billy and Suda - We had fun with this one some time ago in a project collecting additional data and images for the customer's products on the market.  As we were ramping up the project, we tried both ways of connecting an image to a product and there was a few drawbacks we found with using the UDF type of "General" and "Image":
    1.  The image was placed directly on the UDF portion on the Item Master - they were working in large TIFF (?) formats and the picture just looked horrible.  The approving manager could not tell if the image should be approved for press or not.  When he double-clicked on the image in the UDF portion it brought up another SAP window that wasn't quite crystal clear.
    2.  The image took up so much room on the UDF portion of the Item Master that the data entry personnel had to constantly scroll down to enter the other data points (color, size, branded promo, mixture, etc - there were about 12 fields).  Talk about being ticked!
    3.  While using the "General" and "Link" it addressed those concerns BUT there was one extra enormous advantage with this General/Link method.  When the image was brought up, it opened up the image automatically in a standard picture editor/manager program.  If they liked what they saw, they continued foward with the approval of the image for press runs.  If they did not like the image, they were able to manipulate the image at the moment and then follow through with approval (time saver for sure!).
    I am sure it all boils down to what the customer requirements are, but some other clients I demoed this to wanted to switch immediately after seeing that!  But definitely something to think about if you are planning on connecting an image to a product...
    Oh and she really is correct, Billy - I have never heard of anyone linking a query to a "link" or "image" type...I don' t know how you would even do that as the "link" or "image" selection leads you directly into the attachment and/or storage path and location...
    take care - Zal

  • Compare two tables on different server without using Linked Servers

    I have an SSIS package that needs to compare a table to another table on another server.  Then only delete data from the first table if it exists in the second table.  
    I know this is possible with Linked Servers but we are doing away with them in my company.  Is there a way inside of SSIS to do this?
    Oh and I can't use a Data Flow since I don't know the table names or columns at run time (the whole package is dynamic) so I can't map the columns ahead of time.  
    So no MERGE JOIN unless it can be used outside of a Data Flow.  

    You 'll have to use the Data Flow Transformation, thing is, given the constraints, your only option seems to be in generating the package programmatically (using code).
    The type of a program would be a Windows Console. The program would expect a few parameters as the source and target tables along with any necessary connection parameters.
    Then use the merge join (being the easiest to code in) in an Execute SQL Task component.
    Examples of coding packages:
    Samples for creating SSIS packages programmatically
    PS: I can tell you, given your circumstances, at the very minimum the impact on the bottom line of your company is brittle apps accompanied with expensive maintenance which translates into reduced ROI from your tooling.
    Arthur My Blog
    The package is table driven and is a dynamic archival process.  The end user just fills in the framework table and the package archives data from within a certain time range.  The table can exist on any server, any database.  
    That part is done.  The part that still needs to be accomplished is to delete data out of the base table since it is archived.  I need a safe way of doing this and so thought to compare the archive table against the base table.  Because they
    can exist anywhere and can have any name I am not sure how to do this without Linked Servers.  That being said we will not have Linked Servers for this.  
    Is there another safe way to delete data out of the base table?

  • Trying to use Linked Servers in SQL 2005 to connect to RDB 7

    I'm looking for detailed info on how to set up a linked server in SQL 2005 to connect to my Oracle RDB 7 database (running on VMS). I'm able to connect via odbc using VS.Net and Sql Server 2005 Reporting Services. I'm not sure if I need to use the ODP.NET or not. I have created a generic linked server, but it requires me to use the OpenQuery function to access the data, which is not giving me the functionality I'm looking for.

    Hi doanpq,
    Please download and install OLE DB Provider for Visual FoxPro 9.0, which exposes OLE DB interfaces that you can use to access Visual FoxPro databases and tables from other programming languages and applications. Please see:
    http://www.microsoft.com/en-us/download/details.aspx?id=14839
    Then, please follow up the following article to create a linked server:
    Creating Linked Servers:
    http://technet.microsoft.com/en-us/library/ff772782(v=sql.105).aspx
    For more information, you can also take a look at the following article, especially Dave K's comment:
    http://blog.dbase.integralwebsolutions.co.za/2008/10/accessing-your-dbf-tables-via-linked.html
    Elvis Long
    TechNet Community Support

  • Linked servers:Using 64 and 32 bit ODBC providers concurrently

    I have a very odd problem that I hope someone can help me with.  I have a 64 bit odbc MySQL driver.  Unfortunately, although I can connect to the data source from the control panel, the linked server cannot connect to the MYSQL data source.  The
    funny thing is that other linked servers (using the same odbc driver) have no problem connecting to their respective hosts.  The problem seems seems to be between the 64 bit linked server and the host (a shoretel IP phone database that runs on top of
    windows).  I know that the 32 bit driver used to work, but when I rebuilt the server to 64 rather than 32 bit the linked server failed.  What I am trying to do is to use both 64 bit driver and 32 bit driver concurrently (I have installed the 32 bit
    version using the WOW 32 bit odbc tool, but because the SSMS provider dialog only allows me to use the 64 bit system dsn.  I am wondering if I can get the 32 bit version to work as well using a user rather than system dsn.  Is this possible?  I
    can send screenshots of the problem if needed.  Thanks in advance for any advice you can offer.

    What I am trying to do is to use both 64 bit driver and 32 bit driver concurrently
    You can not. You can only use provider of the same 32/64 bit architecture as the SQL Server have.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • DNS forwarder with 2 real DNS servers, querying them simultaneously

    DNS forwarder with >2 real DNS servers, querying them simultaneously and ignoring "server can't find" errors
    Hi. When I connect to VPN, my normal DNS isnt queried, and DNS given by VPN answers: "server can't find"
    An extract from 'man resolv.conf'
    If there are multiple servers, the resolver library queries them in the  order  listed.
    I need another logic. All servers should be queried at the same time, and the soonest positive reply should be used.
    The algorithm  used  is to try a name server, and if the query times out, try the next, until out of name servers, then repeat trying all  the  name  servers  until  a  maximum number of etries are made.
    So, if I get "server can't find" error, the next DNS server not queried. I want the DNS forwarder to ignore such answers and wait for replies from other servers.
    What software can do this? Maybe dnsmasq? I plan to add 'nameserver 127.0.0.1' to the top of my resolv.conf and configure my scripts to add other nameservers below.

    All servers should be queried at the same time
    --all-servers
    dnsmasq: ignoring nameserver 127.0.0.1 - local interface
    good.
    How to tell dnsmasq to completely disable dhcp? List all interfaces like this?
    no-dhcp-interface=eth0
    no-dhcp-interface=tun0
    no-dhcp-interface=vboxnet0
    no-dhcp-interface=wlan0

  • Linked server query using Dynamic SQL

    I have a Linked server query that takes forever to run. WHen I hardcode the acct# it runs fast. However I want these acct numbers int he where clause to be generated dynamically. For eg: below is what I need:
    --Get the 11 Loans from this Table A From the FIRST QUERY
    --- Plug those loans numbers in the second query  In the WHERE Clause eg should looks like  where  ACCT in (1,2,3,5)
    DECLARE
    @sSQL varChar(MAX)
    SET @sSQL
    =
    ' SELECT
    [Loan] FROM TableA D
    EXECUTE(@sSQL)
    --2ND QUERY 
    DECLARE
    @sSQL1 varChar(MAX)
    SET @sSQL1
    ='
    SELECT Field1, 
    Field2,
    Field3,
    Field4,
    Field5
       FROM LinkedServer.Dbaname.dbo.TableB a
    where ACCT in ''('''
    +(@sSQL)
    +
    ''')'''--- This needs to look like  where  ACCT in (1,2,3,5)
    select
    @sSQL1

    Ok, so use this.. instead of your first statement.
    DECLARE @sSQL NvarChar(MAX), @output NVARCHAR(100), @ParmDefinition nvarchar(500);
    SET @ParmDefinition = N'@sqlout NVARCHAR(100) OUTPUT'
    SET @sSQL = N'SELECT DISTINCT @sqlout = STUFF((SELECT '',''+CAST(S2.loan AS VARCHAR(100))
    FROM tableA S2
    FOR XML PATH('''')), 1, 1, '''')
    FROM tableA S1'
    EXECUTE sp_executesql @sSQL, @parmdefinition, @sqlout = @output OUTPUT
    and use @output instead of @sSQL in the second statement.
    You can read about STUFF command @
    http://sqlsaga.com/sql-server/how-to-concatenate-rows-into-one-row-using-stuff/.
    Good Luck :)
    Visit www.sqlsaga.com for more t-sql code snippets or BI related how to's.

  • Executed as user: ADMIN\abc-SQLServer. Linked servers cannot be used under impersonation without a mapping for the impersonated login. [SQLSTATE 42000] (Error 7437). The step failed.

    Hi All, 
    We have verified permissions on both sides,current server and linked server, the user has sysadmin.
    Another key piece of information is that this is happening when executing a SQL Job.
    Thanks.

    Related:
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/328616e9-42cb-40d7-a4b1-671d6a492d8f/linked-servers-cannot-be-used-under-impersonation-without-a-mapping-for-the-impersonated-login?forum=sqldatabaseengine
    https://support.microsoft.com/kb/2492477?wa=wsignin1.0
    http://sshakespeareblog.co.uk/2013/07/31/sql-linked-server-and-sql-server-agent/
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

Maybe you are looking for