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
SQL SERVER - Recycle Error Log - Create New Log file without Server Restart

SQL SERVER – Recycle Error Log – Create New Log file without Server Restart

November 9, 2010
Pinal Dave
SQL Interview Questions and Answers
SQL Error Messages, SQL Scripts, SQL Server

A client’s DBA restarted the server just to start a fresh Error Log. There is no need: you can recycle the log and create a new file without a restart.

Read More
An old spinning wheel taken apart and laid out on a workshop floor in rows from largest part to smallest.

A Bill of Materials With a Recursive CTE

November 8, 2010
Pinal Dave
SQL Tips and Tricks
CTE, SQL Scripts, SQL Server

Expand a bill of materials with a recursive CTE, multiply quantities across levels, trace component paths, and guard against cycles.

Read More
A row of bean jars on a shelf, one jar with a single extra red bean on top

Leap Years in T-SQL: February 29 and Date Math

November 5, 2010
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

Handle leap years in T-SQL with date functions, test February boundaries, and choose a clear anniversary rule for February 29 births.

Read More
An open protected archive case sits before shelves of closed cases ready for inspection.

SQL SERVER – Finding Last Backup Time for All Database

November 4, 2010
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL DMV, SQL Scripts, SQL Server

Last Backup Time comes from recorded history, which I check by backup type. Recovery still needs the files and a tested chain.

Read More
A small basket of green apples sits before larger baskets filled with apples and pears.

COUNT OVER: Show the Filtered Total Beside Page Rows

November 2, 2010
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Order By, SQL Scripts, SQL Server

COUNT OVER helps me keep a page’s row count separate from the filtered total. Compare full and partial pages. An empty page needs an explicit total-count contract.

Read More
Gouache painting of a shelf of cloth-bound books with one book tilted out of the row and a vermilion ribbon bookmark hanging below it

Find the Last Read and Write Time of Every Table in SQL Server

October 31, 2010
Pinal Dave
SQL Tips and Tricks
SQL DMV, SQL Index, SQL Scripts, SQL Server

Find the last read and write time of every table in SQL Server with sys.dm_db_index_usage_stats. The tests show what counts as a read, why an insert counts as a write, what an index rebuild does to the numbers, and what wipes them.

Read More
Gouache painting of a magnifying glass examining database views

SQL SERVER – List of all the Views from Database

October 29, 2010
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL View

Hundreds of Views and no idea which are indexed? A quick query on sys.views lists every view with its schema and whether it is indexed or indexable.

Read More
Previous 1 … 330 331 332 333 334 335 336 … 421 Next
  • Books
  • Testimonials
  • Privacy Policy

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