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
MySQL - Finding First day and Last day of a Month

First Day and Last Day of a Month in MySQL and SQL Server

April 9, 2014
Pinal Dave
SQL Tips and Tricks
MySQL, SQL DateTime, SQL Function, SQL Server

Finding the first day and last day of a month in MySQL takes LAST_DAY and a little date arithmetic. This post checks leap years and timestamp filters, then repeats the task in SQL Server with EOMONTH and DATETRUNC, tested on SQL Server 2025.

Read More
A fridge door standing open at night, its light spilling across an empty kitchen

SET XACT_ABORT ON: Stopping Timeouts From Leaving Open Transactions

April 7, 2014
Pinal Dave
SQL Tips and Tricks
Best Practices, SQL Lock, SQL Server, SQL Transactions

Use SET XACT_ABORT ON to prevent client timeouts from leaving transactions and locks open, with TRY CATCH and a sleeping-session query.

Read More
Three different protective cases hold a complete arrangement, additional pieces and a sequence of linked fittings.

SQL SERVER – Last Full Differential and Log Backup Finish Times

April 4, 2014
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts, SQL Server

I check backup time separately for full, differential and log backups. One latest timestamp cannot describe the entire recovery chain.

Read More
SQL SERVER - Say No to DB Data Roles - SQL Security - Notes from the Field #022

SQL SERVER – Say No to DB Data Roles – SQL Security – Notes from the Field #022

April 3, 2014
Pinal Dave
SQL Tips and Tricks
Notes from the Field, SQL Scripts, SQL Server, SQL Server Security

Brian Kelley explains why he avoids the fixed DB data roles db_datareader and db_datawriter, and how they can compromise your server security.

Read More
A wooden xylophone with bars stepping from long to short, a red mallet resting between two neighbouring bars.

LAG and LEAD: Comparing Each Row With the One Before It

April 2, 2014
Pinal Dave
SQL Tips and Tricks
Ranking Functions, SQL Function, SQL Order By, SQL Server

Use LAG and LEAD for monthly comparisons, handle defaults and percent change, choose explicit frames, and detect status transitions.

Read More
MySQL - List User Defined Tables - Two Methods

MySQL – List User Defined Tables – Two Methods

April 1, 2014
Pinal Dave
SQL Tips and Tricks
MySQL, SQL Scripts, SQL Server, SQL System Table

There are different methods to list out user defined tables in MySQL. We will see two methods in this post.

Let us create the following tables in the database named Test

Read More
An open bento box with neat compartments, one holding a row of small rice balls, a red plum on the rice.

JSON_OBJECT and JSON_ARRAY: Building JSON in SQL Server 2022

March 30, 2014
Pinal Dave
SQL Tips and Tricks
JSON, SQL Function, SQL NULL, SQL Server, SQL Server 2022

Build JSON_OBJECT and JSON_ARRAY values in SQL Server 2022, control null handling, nest arrays, and compare rowset and aggregate output.

Read More
Previous 1 … 249 250 251 252 253 254 255 … 416 Next
  • Books
  • Testimonials
  • Privacy Policy

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