Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Apply COLLATE SQL_Latin1_General_CP1_CS_AS

Author  Topic 

zhshqzyc
Posting Yak Master

240 Posts

Posted - 2010-03-03 : 13:15:51
Hi,

I have a script.
SELECT CONVERT(INT,Substring(MessageID,16,LEN(MessageID)-15)) AS GRP_ID,Message
from MESSAGES
WHERE MessageGroup='Screen' and MessageID LIKE 'MISSION_%'
AND CONVERT(INT,Substring(MessageID,16,LEN(MessageID)-15)) IN (1,2,3)

Because of collate sensitive reason, I want to apply COLLATE SQL_Latin1_General_CP1_CS_AS to it.

Can you please tell me how?

Thanks

vijayisonly
Master Smack Fu Yak Hacker

1836 Posts

Posted - 2010-03-03 : 14:11:44
This?
SELECT CONVERT(INT,Substring(MessageID,16,LEN(MessageID)-15)) AS GRP_ID,Message
from MESSAGES
WHERE MessageGroup COLLATE SQL_Latin1_General_CP1_CS_AS ='Screen' and MessageID COLLATE SQL_Latin1_General_CP1_CS_AS LIKE 'MISSION_%'
AND CONVERT(INT,Substring(MessageID,16,LEN(MessageID)-15)) IN (1,2,3)

Go to Top of Page
   

- Advertisement -