SQL Server – Get Size of Database Files
This script gets the size of each database file, not including backups. Essentially, you’ll see .MDF,...
This script gets the size of each database file, not including backups. Essentially, you’ll see .MDF,...
This is a handy script to show the number of cores and MaxDOP in a single...
Finding Orphaned Users USE [db] GO EXEC sp_change_users_login ‘Report’ GO Fixing Orphaned Users USE [db] GO...
If you’re creating a new index in SQL Server, it is good practice to make sure...
SELECT COL_TO_CHECK, COUNT(COL_TO_CHECK) FROM TABLE_NAME GROUP BY COL_TO_CHECK HAVING COUNT(COL_TO_CHECK) > 1 If there is more...
Returns a report that has information about user permissions for an object, or statement permissions, in...
Within a Stored Procedure, you may want the results of a particular query emailed to you,...
Source of info: http://www.mattbutton.com/2011/06/01/sql-profiler-templates-missing/ Upon trying to create a trace template in SQL Server Profiler, I was...
This is the basic query text to use whenever you need to loop through a result...
Do transactions apply in dynamic SQL, in SQL Server? In a word, yes. For proof, run...