Here is my SQL:
CREATE TABLE #I (S CHAR(6))
INSERT INTO #I SELECT DISTINCT S FROM B
SELECT * FROM A WHERE S IN (SELECT S FROM #I)
Here is the error that I am getting:
Server: Msg 446, Level 16, State 9
Cannot resolve collation conflict for equal to operation.
I know that I could simplify these into one statement, but I have about 12 other SELECT statement that I will need to use the #I table in one way or another. I have simplified my code to post here. Preprocessing the subquery will greatly improve my performance on the other 12 statements. I have similar subquery setups in other procedures, but for some reason this one won't work.
Thanks in advance for any responses to this post.
Will Summers
CREATE TABLE #I (S CHAR(6))
INSERT INTO #I SELECT DISTINCT S FROM B
SELECT * FROM A WHERE S IN (SELECT S FROM #I)
Here is the error that I am getting:
Server: Msg 446, Level 16, State 9
Cannot resolve collation conflict for equal to operation.
I know that I could simplify these into one statement, but I have about 12 other SELECT statement that I will need to use the #I table in one way or another. I have simplified my code to post here. Preprocessing the subquery will greatly improve my performance on the other 12 statements. I have similar subquery setups in other procedures, but for some reason this one won't work.
Thanks in advance for any responses to this post.
Will Summers