SQL Server| Incorporate feedback

Constantify the query and remove use of type keyword