Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Trying to run a query across multiple server with incorrect collation settings

Posted on 2007-10-18
4
Medium Priority
?
425 Views
Last Modified: 2008-09-08
I am trying to run a select statement across a linked server where the join is based on a field of the same type (char) on both databases, but one of the database I believe was setup incorrectly a long time ago and I have no ability to change it

SELECT t1.xxx, t2.xxx, t2.xxx
FROM table1 t1
JOIN table2 t1 on t1.code = t2.code

The error I am getting is
"Cannot resolve collation conflict for equal to operation."

Is there anyway of adding a collation type to the select statement so thay I can compare correctly?
Or is there anything else I can do

Thanks
0
Comment
Question by:mikelittlewood
2 Comments
 
LVL 8

Accepted Solution

by:
matrix_aash earned 200 total points
ID: 20100681
If you are running the query across a linked server you need to user servername.databasename.tablename when you write your select statement

for e.g

Select * from servername.databasename.tablename

Hope this helps.

Aash.
0
 
LVL 15

Author Comment

by:mikelittlewood
ID: 20100696
Sorry my bad I should have written that in as I am already

SELECT t1.xxx, t2.xxx, t2.xxx
FROM table1 t1
JOIN serverlink.cat1.dbo.table2 t1 on t1.code = t2.code
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

578 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question