Comments
Sort by recent activity
I don't use SQL Prompt. I used to work on a whole lot of different systems for many different companies and a lot of them did use it so I never picked up the habit so I wouldn't get used to using it and possibly being lost without it. Who knows? It could become a favorite tool. For now, though, and for the last 10 years, SQL Compare has been my favorite RedGate tool. The methodology we currently use for final checks after UAT is to do a restore of the production database(s) affected and do the full database deployment on that. Then, we do a compare between that and the production database. We also have a rigid standard for how the flower box of code must be laid out especially when it comes to revisions. Yeah... I know that may sound stupid for this day and age but comparing the flower box with those revision tracking comments have saved our hinnies more than once because people can't seem to handle trunks right for SQL especially for long term projects that aren't even close to being CICD. It's a whole lot easier than pawing through trunks and branches and all sorts of other stuff to make sure that there is no regressive code and, at the same time, ensure that everything actually has been both peer reviewed and reviewed by a DBA.
/ comments
I don't use SQL Prompt. I used to work on a whole lot of different systems for many different companies and a lot of them did use it so I never picked up the habit so I wouldn't get used to using ...
Lordy... look at all the stupid spam this attracted. You folks at Redgate need to get a better rake. You folks posting all the spam need to get both a life and a grip on how to effectively advertise. I won't click on spam listings and almost everyone I know of won't either. And, no... you're not clever at all with your "Good Info" posts although it does help me decide which sites visit or products/services to buy because if you'll use deception in spam, you'll use deception in your products and services. / comments
Lordy... look at all the stupid spam this attracted. You folks at Redgate need to get a better rake. You folks posting all the spam need to get both a life and a grip on how to effectively advert...
There's an easy way to do this by using Collation to make things Case Sensitive. What' you're looking for is what is in the WHERE clause in the code below. SELECT * FROM (VALUES --This represents the values in a table (1,'02830916-85AB-47FF-A2CA-2228441840EE','All UPPER CASE') ,(2,'02830916-85ab-47ff-a2ca-2228441840ee','All LOWER CASE') ,(3,'02830916-85aB-47ff-a2ca-2228441840ee','One UPPER CASE') )v(RowNum, GUIDString, Explanation) WHERE GUIDString LIKE '%[A-F]%' COLLATE Latin1_General_BIN ;
As a bit of a sidebar, whoever designed the column as a string datatype instead of the much more appropriate UNIQUEIDENTIFIER, did you a HUGE disservice. Please pardon the formatting of the code. For some reason, the "CODE" paragraph type doesn't like my code and so I had to post it as plain text. Heh... Imagine that.. a forum design to support SQL that doesn't.
/ comments
There's an easy way to do this by using Collation to make things Case Sensitive. What' you're looking for is what is in the WHERE clause in the code below. SELECT * FROM (VALUES --This represent...
From the original post: "I am writing a select statement that looks through a column with guid strings..."
Why anyone would convert 16 byte GUIDS to 36 characters (72 bytes if Unicode!!!) is beyond me. I've heard a lot of "reasons" people offer but none of them have been good. And now we need to find the GUIDs that might have upper case letters in them (which IS the default for how SQL Server displays UNIQUEIDENTIFIERS, btw). I cannot imagine a good reason to do this. And, no... I'm not blaming the OP for any of this.
Anyway... getting to the problem. I might be reading this incorrectly but returning the "values" in this context seems to mean returning the entire value from the column if it contains any upper case letters. Following only that rule, the code is quite simple once you realize that you can easily make the comparison case sensitive by using a binary collation, which is also nasty fast. The thing you're looking for is in the WHERE clause of the following example code.
<br> SELECT *<br> FROM (VALUES --This represents the values in a table<br> (1,'02830916-85AB-47FF-A2CA-2228441840EE','All UPPER CASE')<br> ,(2,'02830916-85ab-47ff-a2ca-2228441840ee','All LOWER CASE')<br> ,(3,'02830916-85aB-47ff-a2ca-2228441840ee','One UPPER CASE')<br> )v(RowNum, GUIDString, Explanation)<br> WHERE GUIDString LIKE '%[A-F]%' COLLATE Latin1_General_BIN<br>;
/ comments
From the original post:"I am writing a select statement that looks through a column with guid strings..."
Why anyone would convert 16 byte GUIDS to 36 characters (72 bytes if Unicode!!!) is beyond ...
Whomever saved GUIDs in a column with a string datatype did you a HUGE dis-service. If I'm reading your problem correctly, the WHERE clause in the following demo code is what you're looking for. It works by using collation to make the comparison CASE SENSITIVE. SELECT * FROM (VALUES --This represents the values in a table (1,'02830916-85AB-47FF-A2CA-2228441840EE','All UPPER CASE') ,(2,'02830916-85ab-47ff-a2ca-2228441840ee','All LOWER CASE') ,(3,'02830916-85aB-47ff-a2ca-2228441840ee','One UPPER CASE') )v(RowNum, GUIDString, Explanation) WHERE GUIDString LIKE '%[A-F]%' COLLATE Latin1_General_BIN ;
And, sorry about the lack of formatting in the code. The "CODE" paragraph type in this forum doesn't work correctly and kept throwing errors or showing the actual html for the code above. Imagine that... an SQL Forum that doesn't support SQL Posts.
/ comments
Whomever saved GUIDs in a column with a string datatype did you a HUGE dis-service. If I'm reading your problem correctly, the WHERE clause in the following demo code is what you're looking for. ...
All you folks that claim that the market is flooded with tools to handle such things as what the op has requested... yeah... how about you post the names of some of the more popular ones and maybe even provide a link or two since you already know so much about them. / comments
All you folks that claim that the market is flooded with tools to handle such things as what the op has requested... yeah... how about you post the names of some of the more popular ones and maybe ...
Lordy... the spammers sure had a field day on this one. [image]
DerFredo cited a really good link by Dwain Camps on the subject. Other than my posts, it's also the only post that has nothing to do with the spam that the others have written. I'm not even going to mention the subject of the spam the others have written for fear of the damned bots and human moroffs posting more spam. / comments
Lordy... the spammers sure had a field day on this one.
DerFredo cited a really good link by Dwain Camps on the subject. Other than my posts, it's also the only post that has nothing to do wi...