Want to control chaos in any IT environment? Want to stop asking why are things breaking? Put in Change Management. It’s staggering […]
Blog Archive
SQL Conversion Between Datetime and Unix Timestamp
Purpose: To convert a datetime value in T-SQL to Unix Timestamp and vice versa. Note: Unix datetime is the number of seconds since […]
SQL Users with matching passwords
use MASTER go SELECT [name],[type_desc],create_date,modify_date,password_hash FROM sys.sql_logins WHERE PWDCOMPARE(lower([name]),password_hash)=1 –Note: Have experienced where case matters or PWDCOMPARE(upper([name]),password_hash)=1 or PWDCompare([name],password_hash)=1 order by [Name]
SQL Login Trigger
Purpose: Enables auditing of logins on a server. Steps: Download the attached script Run the script Create Login Trigger
SQL DBTools Module
Purpose: briefly describes the incredibly useful DBATools module and how to load it. Background The DBATools PowerShell module is a suite of functions […]
SQL Script DB Objects
Purpose: Generates create object scripts from a specified database Steps: Download the attached script Update the $SourceServer, $db, $path, $IncludeTypes, $ExcludeSchemas, and $IncludeSchemas […]
SQL Configure Temp DB
Purpose: Configure TempDB on a SQL Server Steps: Find the number of processors available to SQL Server on the server. Download the attached […]
SQL Server: Troubleshoot Login Trigger
Purpose: To document the procedure required to remediate a loss of SQL Server access caused by a logon trigger. Background As part of […]
SQL DDL Audit Log Trigger
— Audit Log Script USE Configuration GO –All connections to the database must be cleared first before enable broker can complete IF(SELECT […]
SQL Default Template for Query Window
Edit the sqlfile.sql file located in: (SSMS 2008) C:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\SqlWorkbenchProjectItems\Sql (SSMS 2005) C:\Program Files\Microsoft SQL Server\90\Tools\Binn\VSShell\Common7\IDE\sqlworkbenchprojectitems\Sql /* Description: Author: Date: […]