TSQL – Get Number Of Cores & MaxDOP In Single Query Writer #1, 2016-03-19 This is a handy script to show the number of cores and MaxDOP in a… Continue Reading
TSQL – Orphaned User Script Writer #1, 2016-03-19 Finding Orphaned Users USE [db] GO EXEC sp_change_users_login ‘Report’ GO Fixing Orphaned Users USE [db]… Continue Reading
Finding Duplicate Records In Database Writer #1, 2016-03-19 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… 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 – 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
TSQL – Loop Through Result Set WITHOUT Cursors Writer #1, 2013-05-202024-09-02 There is some controversy about using cursors in TSQL. Overall, I believe they tend to… Continue Reading
TSQL – Simple Loop Through Result Set Using Cursor Writer #1, 2013-02-012024-09-02 (If you want to AVOID cursors, see: TSQL – Loop Through Result Set WITHOUT Cursors) This… Continue Reading