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
Colored axle collars being exchanged while cotter pins and chains stay attached

Renaming a Table With Almost No Downtime Using sp_rename

March 29, 2018
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

A rename swaps names in a blink, yet the foreign key and permissions stay with the old table. Here is a short demo and a safer swap.

Read More
Backup database to disk error.

SQL SERVER – FIX: Msg 3009 – Could Not Insert a Backup or Restore History Detail Record in the MSDB Database

February 1, 2018
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Error Messages, SQL Scripts, SQL Server, SQL System Table, System Database, TraceFlags

A backup finished but raised Msg 3009: could not insert a backup or restore history detail record in msdb. Here is why, with steps to reproduce it.

Read More
Small snorkeling fin casting an enlarged shadow on a cream wall

ROWCOUNT and PAGECOUNT: Faking a Big Table to Test Plans

September 6, 2017
Pinal Dave
SQL Tips and Tricks
SQL System Table, SQL Table Operation, Table Partitioning, Temp Table

You can tell the optimizer a three-row table has 10 million rows and watch the plan change. Here is how, and how to undo it.

Read More
A polished wooden ship's wheel on an old ship's bridge with a child's swimming bag hanging from one spoke.

Finding User Objects in master Created by Accident

July 24, 2017
Pinal Dave
SQL Tips and Tricks
DBA, SQL Dependency, SQL Server, SQL System Table, System Database

Find user objects in master, inspect their purpose and dependencies, and prepare a safe move without removing deliberate server helpers.

Read More
SQL SERVER - Invalid Object Name 'master.dbo.spt_values' in Management Studio

SQL SERVER – Invalid Object Name ‘master.dbo.spt_values’ in Management Studio

July 21, 2017
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, SQL Server Management Studio, SQL System Table

A client ran U_tables.sql from the Install folder by hand and then hit Invalid Object Name ‘master.dbo.spt_values’ in Management Studio. Here is why.

Read More
Three individually tagged preserve jars sit inside one wooden destination crate

What does BACKUP WITH NAME Command do? – Interview Question of the Week #130

July 9, 2017
Pinal Dave
SQL Interview Questions and Answers
SQL Backup and Restore, SQL Scripts, SQL Server, SQL System Table

What does BACKUP WITH NAME do? It simply names your backup, and you can then find that name in the msdb backupset table. Here is a quick example.

Read More
Gouache painting of rows of vegetable plants each starting with a blank stake, the first one painted red

How to Get Column Names From a Table in SQL Server

July 6, 2017
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Scripts, SQL Server, SQL System Table

To get column names from a table in SQL Server, query sys.columns with OBJECT_ID, or read INFORMATION_SCHEMA.COLUMNS. This tutorial tests four methods on a demo table, shows the schema trap that returns too many columns, and builds a paste-ready column list. It also finds every table that has a given column.

Read More
Previous 1 2 3 4 5 6 7 … 18 Next
  • Books
  • Testimonials
  • Privacy Policy

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