SQL Server – Email Results of Stored Procedure Conditionally Writer #1, 2016-03-19 Within a Stored Procedure, you may want the results of a particular query emailed to… Continue Reading
SQL Server Profiler New Templates Failing Writer #1, 2016-03-19 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… Continue Reading
TSQL – Simple Loop Through Result Set Using Cursor Writer #1, 2016-03-19 This is the basic query text to use whenever you need to loop through a… Continue Reading
Rolling Back Dynamic SQL Writer #1, 2016-03-19 Do transactions apply in dynamic SQL, in SQL Server? In a word, yes. For proof,… Continue Reading
SQL Server – Find Missing Indexes With Script In Output Writer #1, 2016-03-18 Source: http://sqlserverplanet.com/dmvs/missing-indexes-dmv SELECT mid.statement ,migs.avg_total_user_cost * (migs.avg_user_impact / 100.0) * (migs.user_seeks + migs.user_scans) AS improvement_measure… Continue Reading
SQL Server – Download all RDL files from Report Server Writer #1, 2016-03-18 —- Allow advanced options to be changed. –EXEC sp_configure ‘show advanced options’, 1 –GO —-… Continue Reading
PowerShell – Query Database Remotely Writer #1, 2016-03-18 The basic syntax for sending a query to SQL Server using PowerShell. sqlcmd -S SERVER_NAME… Continue Reading
PowerShell – Get All SQL Server Instances In Environment Writer #1, 2016-03-18 cls import-module failoverclusters Import-Module -Name SQLPS -DisableNameChecking $servers = “comma”,”separated”,”server”,”list” foreach($server in $servers) { try… Continue Reading
Fixing Orphaned Users On A Large Scale Writer #1, 2016-03-16 A script that generates a script to fix all orphaned users at once. Continue Reading
Recovering a database in RESTORING state Writer #1, 2016-03-16 How to get your database out of the “restoring” state so you can use it again. Continue Reading