TSQL – Get Number Of Cores & MaxDOP In Single Query benjf.com.blog@benjf.com, 2016-03-19 This is a handy script to show the number of cores and MaxDOP in a… Continue Reading
TSQL – Orphaned User Script benjf.com.blog@benjf.com, 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 benjf.com.blog@benjf.com, 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 benjf.com.blog@benjf.com, 2016-03-19 This is the basic query text to use whenever you need to loop through a… Continue Reading
TSQL – Loop Through Result Set WITHOUT Cursors benjf.com.blog@benjf.com, 2016-03-19 There is a time and a place for everything, cursors included. Here is one way… Continue Reading
Rolling Back Dynamic SQL benjf.com.blog@benjf.com, 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 benjf.com.blog@benjf.com, 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 benjf.com.blog@benjf.com, 2013-05-20 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 benjf.com.blog@benjf.com, 2013-02-01 (If you want to AVOID cursors, see: TSQL – Loop Through Result Set WITHOUT Cursors) This… Continue Reading