To get the current timestamp in Python, import datetime, call now and format the result with strftime. This post prints the same date and time in Python and in T-SQL, compares the two clocks, and shows how to ask for UTC in both.
sp_execute_external_script: Run Python Inside SQL Server
Before you write any Python, check four switches. Here is how to read them, what error 39023 means, and what to test on your own server.
SQL SERVER – NOLOCK with DMVs
NOLOCK with DMVs is not a blanket reassurance against monitoring waits. A customer asked about omitting the hint.
SQL SERVER – Get Last Restore Date
I report Restore Date from the latest retained msdb history row. My earlier query returned every matching entry.
Reclaim Space After Dropping a Column With DBCC CLEANTABLE
To reclaim space after dropping a column, run DBCC CLEANTABLE or rebuild the index. This post measures both on a demo table and shows that CLEANTABLE shrinks the rows while only a rebuild returns the pages.
SQL SERVER – Easiest Way to Copy All Stored Procedure Definitions
Object Explorer Details helps copy procedure definitions through SSMS scripting. I select the procedures and review the generated script before execution.







