July 4, 2009 at 3:15 am
I am having trouble getting the below query to return 2 rowcount.
SELECT Name, Command, Version, MIN([Source]) as [Source]
FROM
(
SELECT '[test methods].[Insert into ports.ssms.command]' as [Source], 'NAME' AS Name, 'COMMAND' AS Command, 'VERSION' AS Version
UNION ALL
SELECT '[test methods].[Insert into ports.ssms.command]' as [Source], 'name', 'command', 'version'
) [temp]
GROUP BY Name, Command, Version
HAVING COUNT(*) = 1
The problem has something to do with how the GROUP BY is comparing these strings. Is there a way to control this behavior?
July 4, 2009 at 5:23 am
The collation designator settings of the database should be case sensitive. check out BOL for details.
July 4, 2009 at 5:29 am
these two links contains details on how to make a query case sensitive. Hope they'll be of use to you.
http://vyaskn.tripod.com/case_sensitive_search_in_sql_server.htm
http://sqlserver2000.databases.aspfaq.com/how-can-i-make-my-sql-queries-case-sensitive.html
July 4, 2009 at 2:16 pm
Recreating the database this time with CS in the COLLATION did the trick. Thank you for the helpful response.
Cory Robertson
Viewing 4 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply