This month's discount Comprehensive Database Performance Health Check · Testimonials
SQLAuthority with Pinal Dave
Home
  • Consulting
    • Health Check
  • Free Videos
  • All Articles
    • AI
    • SQL Performance
    • SQL Tips and Tricks
    • Interview Questions and Answers
    • SQL Puzzle
    • SQL Video
    • SQLAuthority News
    • Personal
  • Books
  • Consulting
Gouache painting of a plain stone sundial next to a sand hourglass with a vermilion frame

Current Timestamp in Python and SQL: One Format, Two Tools

September 23, 2021
Pinal Dave
SQL Tips and Tricks
Python, SQL DateTime, SQL Server

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.

Read More
A sushi rolling mat shaping ingredients outside their original bowls

sp_execute_external_script: Run Python Inside SQL Server

September 22, 2021
Pinal Dave
SQL Tips and Tricks
Best Practices, Python, 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.

Read More
Gouache painting: a wooden loom holding a half-woven linen runner in cream and sage, the last stretch unpicked into loose threads on the floor, with one vermilion knot marking where the finished cloth ends

SAVE TRANSACTION: Roll Back Half a Transaction

September 15, 2021
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Lock, SQL Stored Procedure, SQL Transactions

SAVE TRANSACTION sets a marker inside an open transaction. You can roll back to it and keep the earlier work. This post tests it on SQL Server 2025. It shows why a nested BEGIN TRAN can’t do the same and what XACT_STATE() returns after an error.

Read More
An inspection bridge observes a workpiece while separate holding mechanisms remain visible.

SQL SERVER – NOLOCK with DMVs

September 14, 2021
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Lock, SQL Scripts, SQL Server

NOLOCK with DMVs is not a blanket reassurance against monitoring waits. A customer asked about omitting the hint.

Read More
The uppermost retained restoration folio is examined beside older preserved records.

SQL SERVER – Get Last Restore Date

September 10, 2021
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL Server

I report Restore Date from the latest retained msdb history row. My earlier query returned every matching entry.

Read More
Gouache painting of a bakery board half clean and half crumbs with a vermilion pastry brush

Reclaim Space After Dropping a Column With DBCC CLEANTABLE

September 9, 2021
Pinal Dave
SQL Tips and Tricks
SQL Data Storage, SQL Scripts, SQL Server, SQL Server DBCC

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.

Read More
A carved wooden master and three matching relief tiles sit beside a screw press in a textured gouache workshop.

SQL SERVER – Easiest Way to Copy All Stored Procedure Definitions

September 8, 2021
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Server Management Studio, SQL Stored Procedure

Object Explorer Details helps copy procedure definitions through SSMS scripting. I select the procedures and review the generated script before execution.

Read More
Previous 1 … 24 25 26 27 28 29 30 … 570 Next
  • Books
  • Testimonials
  • Privacy Policy

© 2006 – 2026 All rights reserved. pinal @ SQLAuthority.com