My almost two year-old daughter, Dora, loves to read Sandra Boynton. She loves the pictures. She loves to laugh at all the punchlines. Her recent favorite is Philadelphia Chickens, which is a book/CD combo by Ms. Boynton. Dora asks for the book by the name “Cows” which is the title of the first song. I [...]
When I was working with Oracle, I got hooked on using MINUS and INTERSECT. Well, it turns out that Microsoft implemented these functions in a slightly different way in SQL 2005. Jeff Smith lays out a nice example here.
My friend Gary is fulfilling his life-long dream to take a trip around the world. This being the internet age, we get to follow along from the comfort of our living rooms without having to get the shots. I encourage you to check it out. Gary is one of the funniest and smartest people I [...]
Here’s a little BI humor for anyone from one of my favorite BI writers: Donald Farmer.
Also on the subject of checksum testing, this query will generate a checksum query for a given table. Use this query to generate the checksum for each table, then customize the sum() clauses if you did any transformations on your data. select case a.xtype when 167 then ‘SUM(LEN(‘+a.name+’)) as sum_len_’+a.name+’,’ when 175 then ‘SUM(LEN(‘+a.name+’)) as [...]
select upper(b.name) as table_name, upper(a.name) as column_name, a.colid, a.length, a.xprec, a.xscale, a.xtype,(CASE WHEN a.xtype=167 then ‘varchar’ WHEN a.xtype=175 then ‘char’ WHEN a.xtype=61 then ‘datetime’ WHEN a.xtype=106 then ‘decimal’ END) as col_type from syscolumns a, sysobjects b where a.id=b.id and b.xtype=’U’ and upper(b.name) ‘DTPROPERTIES’ order by b.name, a.name, a.colid
Here is a useful query for getting a list of failed jobs from SQL Server. If you are responsible for tracking and logging job failures, this administrative work can be overwhelming in a busy week. This query will list all jobs that failed during a given time period. It uses a function that I created, [...]