When migrating SQL databases to new server, one of the challenge is to identify all the hard-coded references to old servers or services. Here is a small piece of code that I wrote to search all databases to identify all objects with references to specific keywords or phases. […]
Category: MS SQL Server
Find missing indices using dynamic management views in SQL Server
For SQL Server performance tuning, besides rebuild index and update statistics, often we also need to identify missing indexes. This can be done from SQL Tuning Advisor, but I personally feel it’s quicker to directly query the dynamic management views. Here is a sample query I normally use to identify and generate index creation scripts […]
Download all RDL report files from SSRS server
Following code has been tested on SSRS 2010 to 2016 Install the Reporting Service Powershell Module 2. Code to download RDLs […]
Cascade Delete in MS SQL Server
Different from ORACLE and MySQL, MS SQL Server does not provide Cascade delete function natively. This maybe considered as a safety feature to prevent unintentional data deletion, however, there are situations, that need Cascade Delete to quickly clean up data in complex referenced tables. To easy my life, this is what I wrote. It’s been […]