Posts

Showing posts from November, 2019

Cleaning a Cat Tree

If you have a cat and a cat tree, you probably have the same problem. At least once a year, it's necessary to take a vacuum to the cat tree to clean off the clumps of cat hair that seem woven into the carpeting. In the past, I've just used the brush attachment for the vacuum, which is better than the normal vacuum hose, but ends up as a 15-minute toil, working away at the bits of hair. So yesterday, as I prepared to do it again, a thought occurred to me. What would happen if I used a de-shedder tool on the carpeting? I have a Furminator that I used on a regular basis with my cats and dogs, and it's always done a great job for grooming their hair.  So, I gave it a try, and the answer is that it works amazingly well. The metal teeth are able to really grab and pull the hairs out from the carpeting, and it's also easy to get into the corners where the hair gets matted and nasty. Once I brushed over the entire surface, which only took a few minutes, I gave it another once...

Automatic SQL Server Database Documentation

Recently, I've been looking for a good way to automatically generate a data dictionary for multiple databases. Some are internally developed, and others are vendor-provided. My company already had licenses for SAP Power Designer, but the reports generated by that software didn't have a great layout for end-users, and reverse-engineering a PDM from a database would choke on the complicated databases with 100+ tables and other objects. I needed an easy way to use a database or SQL script to generate the documentation. Criteria: Open-source is preferred, but not mandatory HTML or PDF output List basic objects like tables, indexes, and foreign key references to other tables Show the details on each object, like datatype and included index columns Showing information in extended properties would be nice, but not necessary Editing the metadata would not be necessary, as that wouldn't be allowed on vendor db's Cross-platform support for MS SQL, DB2, and MySQL A w...

Performance of SQL Server Substring Searches

Image
SQL Server offers several methods to find a substring in expressions. I extended a post  found here by adding the PATINDEX method, and also checking against the legacy cardinality optimizer to see if there were any differences under that query hint. 5 methods were used: LIKE SUBSTRING – can only use this method if the substring either starts or ends the string, and only available in SQL 2016+ LEFT/RIGHT – can only use this method if the substring either starts or ends the string CHARINDEX PATINDEX 4 situations were compared: A clustered indexed column A non-clustered indexed column A non-indexed column A loop through a list of strings, using an “IF (<method>)” to search inside the string on each loop iteration (not a common usage) Results under OPTION (USE HINT('FORCE_LEGACY_CARDINALITY_ESTIMATION')) Results under SQL Server 2017 Summary of results: If you force the legacy cardinality: PATINDEX and CHARINDEX are the ...

First Post

First post!  Might as well keep it simple, and post the inspiration for the blog name: Desiderata Go placidly amid the noise and the haste, and remember what peace there may be in silence. As far as possible, without surrender, be on good terms with all persons. Speak your truth quietly and clearly; and listen to others, even to the dull and the ignorant; they too have their story. Avoid loud and aggressive persons; they are vexatious to the spirit. If you compare yourself with others, you may become vain or bitter, for always there will be greater and lesser persons than yourself. Enjoy your achievements as well as your plans. Keep interested in your own career, however humble; it is a real possession in the changing fortunes of time. Exercise caution in your business affairs, for the world is full of trickery. But let this not blind you to what virtue there is; many persons strive for high ideals, and everywhere life is full of heroism. Be yourself. Especially d...