Creating link server Linked servers problems and workarounds

Source: Internet
Author: User

Problem Description

Today, when you do a database migration and then create a new link server (linked server), you encounter the following issues.

My SQL script is like this.

Then, you receive the following error message when you execute it.

MSG 468, Level A, State 9, line 7

Cannot resolve the collation conflict between "Latin1_General_CI_AS" and "sql_latin1_general_cp1_ci_as" in the equal to OP Eration.


cause Analysis

Depending on the error message, it is easy to find because the collation of the current DB is inconsistent with the collation of the DB corresponding to the linked server.

However, it is sql_latin1_general_cp1_ci_as to confirm that the collation of the current DB is exactly the same as the DB collation of the linked server pair.

Solutions

Of course, my solution here is just an alternative solution.

Since I created it through UI actions, I changed the scenario by using a SQL script (which can be used to find a normal link server right-click Export script and then modify it) to create the result.

Create a script for the link server:

/** * * * * object:linkedserver [Hp580dbsz] Script date:09/10/2015 17:25:22 * * * * **/IF  EXISTS(SELECTSrv.name fromSys.servers SRVWHEREsrv.server_id!= 0  andSrv.name=N'Hp580dbsz')EXECMaster.dbo.sp_dropserver@server=N'Hp580dbsz',@droplogins='droplogins'GO/** * * * * object:linkedserver [Hp580dbsz] Script date:09/10/2015 17:25:22 * * * * **/EXECMaster.dbo.sp_addlinkedserver@server =N'Hp580dbsz',@srvproduct=N'Hp580dbsz',@provider=N'SQLNCLI10',@datasrc=N'Hp580dbsz\dev' /*For security reasons the linked server remote logins password are changed with ########*/EXECMaster.dbo.sp_addlinkedsrvlogin@rmtsrvname=N'Hp580dbsz',@useself=N'False',@locallogin=NULL,@rmtuser=N'SA',@rmtpassword='Ctrip.hp580dbsz.dev'GO

Issues and workarounds for creating link server linked Servers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.