Monthly Archives: February 2014

SQL – Remove special Characters from string

I had a requirement to eliminate all the special characters except alphabets and numbers. The traditional way to handle it REPLACE( REPLACE( ‘#My &String’, ‘!’, ” ), ‘#’, ” ) was not helping as I need to list all possible … Continue reading

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

TSQL2012 – Less frequently used features – Revision 01

I have started revising TSQL2012 book, thought of capturing few less frequently used features/clauses: * WITH TIES * PERCENT * OFFSET-FETCH Filter — To eliminate first x rows in the result set * Window Functions – rownumber() over PARTITION * … Continue reading

Posted in Uncategorized | 1 Comment

MPP Viewer – Link

I had to open .mpp file but I do not have Microsoft project. was handy, helped me to view details.

Posted in Referene, Useful Link | Tagged , , , , , | Leave a comment

Microsoft product lifecycle information This link helps to find Microsoft product Lifecycle Start date, Support end date, and Extended Support end date Difference between Main stream and extended support: Lifecycle Policy FAQ:

Posted in Referene, Useful Link | Tagged , , , , , | Leave a comment

SQL 2014 New Feature – Natively Compiled Stored Procedure

How is it different from normal Stored Procedure? A natively compiled stored procedure is compiled when it is created, rather than when it is executed. That compile process first translates the store procedure code into ā€œCā€, and then into machine … Continue reading

Posted in SQL, sql2014 | Tagged , , , , , | Leave a comment

Free eBook on Performance Tuning with SQL Server Dynamic Management Views

Free eBook Performance Tuning with SQL Server Dynamic Management Views by Louis Davidson and Tim Ford is available for download at This book talks about DMVs available related to Execution, Transactions, Indexes, I/O, and SQL Operation system. Best part … Continue reading

Posted in Performance, Referene, SQL | Tagged , , , , , , , | Leave a comment

SQLServer-SSIS-Wrong execution status- MaximumErrorCount

I was investigating abnormal behavior of SSIS package, the package completed successfully but failed to complete actual dataflow task. MaximumErrorCount value was the culprit, its value changed from 1 to 1000! Changing MaximumErrorCount value from 1 to X indicates SSIS … Continue reading

Posted in SQL, SQL Error, SSIS | Tagged , , , , , | Leave a comment

sql transactions – Nested transactions, Saving transactions

Today I come across an interesting article about SQL Transactions by Kenneth Fisher. This blog and subsequent pointers explains very well about transactions, nested transactions, saving transactions and best practices of using transactions in stored procedures. I was experimenting around … Continue reading

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

Run query on multiple databases or tables sp_msforeachdb or sp_msforeachtable

I had been using sp_msforeachdb for long to search any object (table, column, Procedure, etc) on a given SQL instance. I come across similar SP sp_msforeachtable which can be used to run against all tables. Example:

Posted in SQL, SQL Query | Tagged , , , , , , | 2 Comments