Archive for June, 2007

CASE in Cursor

June 19, 2007 Posted Under: sql   Read More

So we have an audit that tells us if our have the latest backup files or not. Our backup job runs Sunday – Wednesday. Our alert get kicked off Thursday – Saturday complainting that we miss some backups. I had to modify the job to stop the annoyance. The SP was created by someone a [...]

Comparing two tables

June 5, 2007 Posted Under: sql   Read More

I needed to compare two tables and display the differences … I found a block of code on the net that did the trick: SELECT MIN(TableName) as TableName, serverName, SLA, contactMethod, chargeBackGroup, BUITBillID, BUITSponsorID, dataCenter FROM (SELECT ‘Source’ as TableName, a.servername, a.SLA, a.contactMethod, a.chargeBackGroup, a.BUITBillID, a.BUITSponsorID, a.dataCenter FROM basedTable a UNION ALL SELECT ‘Destination’ as [...]