Monthly Archives: July 2014

PIVOT and UNPIVOT code sample

Writing PIVOT and UNPIVOR statements is tricky, I will explain with simple example for easy understanding. You may try on your own in 2 minutes • Create a table with Month, WeekDay, Subtotal • PIVOT table data to view in … Continue reading

Posted in Script, SQL, SQL Query | Tagged , , | Leave a comment

Knowledge Share 2014-07

SYNONYM SYNONYM is used to reference an object in usable format. Syntax: create synonym UsableName for Server.DBName.SchemaName.TableName Note: The base object need not exist at synonym create time. SQL Server checks for the existence of the base object at run time. … Continue reading

Posted in knowledge, SQL, Windows Server | Tagged , , , | Leave a comment

Find and update the owner of SQL Job, Maintenance Plan

When we update Maintenance plan, ownership of the job will be changed back to plan owner (In my case it was inactive account resulting job failure). This is a known bug in SQL Server 2005 and SQL Server 2008. (Ref: … Continue reading

Posted in Productivity, Script, SQL, SQL Query | Tagged , , , , , | Leave a comment