SQL SERVER – How to Identify Columns Used In A View?

The views are very tricky. Sometimes they help performance and sometimes they negatively impact performance. Recently, during Comprehensive Database Performance Health Check, I realized that one of the view was the real performance killer. The challenge was to identify column used in a view. We decided to open the view and list all the columns but that was very cumbersome tasks. Finally, we decided to write a script which can help identify columns used in a view. 

Read More

SQL SERVER – Script: Remove Spaces in Column Name in All Tables

Long time ago I have written blog to rename column name.
SQL SERVER – How to Rename a Column Name or Table Name
One of the reader asked me if I can provide a script to remove space from all column names for all tables in a database? My first reaction was – “Are you sure you want to do that? There are chances that after changing the name of the column, the application code might break. If the table has been referred in stored procedure or functions or other objects”

Read More