SQL SERVER – 2005 – Forced Parameterization and Simple Parameterization – T-SQL and SSMS

SQL Server compiles query and saves the procedures cache plans in the database. When the same query is called it uses compiled execution plan which improves the performance by saving compilation time. Queries which are parametrized requires less recompilation and dynamically built queries needs compilations and recompilation very frequently. Forced…
Read More

SQL SERVER – Get Permissions of My Username / Userlogin on Server / Database

A few days ago, I was invited to one of the largest database company. I was asked to review database schema and propose changes to it. There was special username or user logic was created for me, so I can review their database. I was very much interested to know what kind of permissions I was assigned per server level and database level. I did not feel like asking their Sr. DBA the question about permissions.

Read More

SQL SERVER – Three T-SQL Script to Create Primary Keys on Table

I have always enjoyed writing about three topics Constraint and Keys, Backup and Restore and Datetime Functions. Primary Keys constraints prevents duplicate values for columns and provides unique identifier to each column, as well it creates clustered index on the columns. -- Primary Key Constraint upon Table Created Method 1…
Read More