A quick example of the datetime function TODATETIMEOFFSET in SQL Server, and how it differs from SWITCHOFFSET when offsets change.
SQL SERVER – Datetime Function SWITCHOFFSET Example
SWITCHOFFSET changes a datetimeoffset value from its stored time zone offset to a new one. Here is a quick example of how it works in SQL Server 2008.
SQL Server: Why INSERT OUTPUT Does Not Prove a Commit
INSERT OUTPUT can return an identifier before a transaction commits. These tested examples show a rollback after a returned row and a pattern that returns results after commit.
SQL SERVER – The Self Join – Inner Join and Outer Join
Is a Self Join an inner join or an outer join? It can be either. I build a small new example that shows Self Join as inner join and outer join.
SQL SERVER – Upper Case Shortcut SQL Server Management Studio
Want an upper case shortcut in SSMS? Select a keyword and press CTRL+SHIFT+U to make it upper case, or CTRL+SHIFT+L to make it lower case.
SQL SERVER – PowerShell Version Info
Two commands show your PowerShell version: $PSVersionTable and $host. Only one worked on Version 1, so I ask PowerShell experts to explain why.
SQL SERVER – Index Levels, Page Count, Record Count and DMV – sys.dm_db_index_physical_stats
How many pages does an index use, and how many B-Tree levels does it have? sys.dm_db_index_physical_stats shows index levels, page count and record count.







