Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can you collate when using 2 select statements???

Status
Not open for further replies.

Paladyr

Programmer
Apr 22, 2001
508
US
Like this:

select * from table1 COLLATE SQL_Latin1_General_Cp1_CS_AS where field1 not in (select field2 from table2)

I've already re-written the query using a left outer join to pull the correct results but was wondering if it is possible to collate when selecting two tables.
 
collate is not applicable at a table level. It is only meaningful for individual values.

What are you trying to accomplish?
 
I already know the query I need, this is it:

Select * from table1 LEFT OUTER JOIN table2 On table1.field1 = table2.field2 COLLATE SQL_Latin1_General_Cp1_CS_AS Where table2.field2 Is Null

How should that look if I do a select blah blah not in (select blah blah)???
 
Also, the above query works and returns the correct results. SHould it look like this:

select * from thompsonte01.projects where projid not in (select cStudy_Number from schedule.dbo.TIDNumber COLLATE SQL_Latin1_General_Cp1_CS_AS)
 
select * from thompsonte01.projects where projid not in (select cStudy_Number COLLATE SQL_Latin1_General_Cp1_CS_AS from schedule.dbo.TIDNumber)

Sorry I meant this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top