Script to create unsigned data types in SQL Server.
Here’s a link to my gist for a SQL script to return a string from bytes formatted as a larger unit. Link: https://gist.github.com/Protiguous/c40ef32ee4fa0f4e93c9413d6cc3d6bd
I came across this quick example that shows how easily the tiniest little mistake could end up deleting rows from your table. The solution to this bug? Always name & reference your tables, CTE, and subqueries! And now you can play: Spot the Bug™!
Here is Brent Ozar’s SQL script to add important alerts: via Agent Alerts Not Configured – Brent Ozar Unlimited® This script sets up SQL Server Agent alerts for severity 16 through 25 as well as specific alerts for 823, 824 and 825 errors. Do a search & replace in this code and change ‘The DBA… Continue reading Agent Alerts Not Configured – Brent Ozar Unlimited®
Tip: DateTime2(3) has the same number of digits as DateTime but uses 7 bytes of storage instead of 8 bytes (SQLHINTS- DateTime Vs DateTime2).