Adding SQL Query for MSSQL server

SQL Query for MSSQL server