| |

VerySource

 Forgot password?
 Register
Search
View: 718|Reply: 4

Error: Cannot resolve collation conflict for equal to operation.

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-2-6 10:30:01
| Show all posts |Read mode
A simple SQL statement:
SELECT distinct HoldNumber FROM HoldPart WHERE HoldNumber IN
(SELECT HoldNumber FROM [OPTION] .dbo.HoldPart)

Runtime prompt: Cannot resolve collation conflict for equal to operation.
I don't know why, there are masters!
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-3-25 16:45:01
| Show all posts
SELECT * FROM HoldPart WHERE HoldNumber IN
(SELECT distinct HoldNumber FROM [OPTION] .dbo.HoldPart)
Reply

Use magic Report

0

Threads

40

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-26 15:30:02
| Show all posts
SELECT distinct HoldNumber
FROM HoldPart
WHERE HoldNumber IN
(SELECT distinct HoldNumber FROM [OPTION] .dbo.HoldPart)

Do not have duplicates in the result set of in
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-3-26 20:15:01
| Show all posts
--try
SELECT distinct HoldNumber FROM HoldPart WHERE HoldNumber IN
(SELECT distinct HoldNumber FROM [OPTION] .dbo.HoldPart)
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-27 09:15:01
| Show all posts
It is because when the two tables are defined, the Collation of the HoldNumber field is different.

You can use sp_help to see what the Collation of the HoldNumber field in these two tables are ~
If they are not the same, there are two situations:
1. Change the Collation of the HoldNumber field in a table to make the Collation of the two tables the same
2.Add Collate conditions to explicitly specify Collation when querying
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list