Finding Duplicate Records In Database
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...
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...
—- Allow advanced options to be changed. –EXEC sp_configure ‘show advanced options’, 1 –GO —- Update...
$assemblylist = “Microsoft.SqlServer.Management.Common”, “Microsoft.SqlServer.Smo”, “Microsoft.SqlServer.Dmf “, “Microsoft.SqlServer.Instapi “, “Microsoft.SqlServer.SqlWmiManagement “, “Microsoft.SqlServer.ConnectionInfo “, “Microsoft.SqlServer.SmoExtended “, “Microsoft.SqlServer.SqlTDiagM “,...
Do transactions apply in dynamic SQL, in SQL Server? In a word, yes. For proof, run...
(If you want to AVOID cursors, see: TSQL – Loop Through Result Set WITHOUT Cursors) This is...