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
An unmarked seven-compartment organizer sits beside a movable grouping boundary.

SQL SERVER – Find Week of the Year Using DatePart Function

September 2, 2016
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Server

The DATEPART function returns a week number according to its week definition. I choose that convention before using calendar logic.

Read More
Tent pegs and slack guy ropes in a flattened patch of grass where a tent used to be

Finding Orphaned Child Rows Before Adding a Foreign Key

September 1, 2016
Pinal Dave
SQL Tips and Tricks
Database, SQL Constraint and Keys, SQL Scripts, SQL Server

Find orphaned child rows before adding a foreign key, review their business meaning, validate relationships, and confirm constraint trust.

Read More
A red stop rests across a filled pitcher beside an empty receiving bowl.

SQL SERVER – How to Fix Error 8134 Divide by Zero Error Encountered

August 27, 2016
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server

Error 8134 means an expression tried to divide by zero. I choose the intended undefined-result behavior before guarding the division.

Read More
Gouache painting of a small locomotive pulling a single red wagon with nothing behind it on an empty track

How to Attach a Database Without Log File in SQL Server

August 26, 2016
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Server, SQL Server Management Studio, Transaction Log

To attach a database without log file, run CREATE DATABASE with FOR ATTACH_REBUILD_LOG, or remove the missing log in the SSMS Attach dialog. This tutorial builds a demo database, detaches it, and rebuilds the log on attach. It also explains when the rebuild is impossible and what to check afterward.

Read More
SQL Management Studio error dialog box.

SQL SERVER – Fix Error – Cannot use the backup file because it was originally formatted with sector size 4096 and is now on a device with sector size 512

August 25, 2016
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Error Messages, SQL Scripts, SQL Server

SSMS backup failed with ‘Cannot use the backup file because it was originally formatted with sector size 4096’. Here is why it happens and the easy fix.

Read More
SQL server failure dialog.

SQL SERVER – Script level upgrade for database ‘master’ failed because upgrade step ‘upgrade_ucp_cmdw.sql’

August 24, 2016
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Server

After a cluster failover, SQL Server would not start on Node2 because upgrade step ‘upgrade_ucp_cmdw.sql’ failed. Here is what the ERRORLOG showed.

Read More
A washing line at dawn with pegged shirts in a row and one shirt fallen on the wet grass below

Listing Last Night’s Failed Agent Jobs With One msdb Query

August 23, 2016
Pinal Dave
SQL Tips and Tricks
DBA, SQL Scripts, SQL Server, SQL Server Agent

List failed Agent jobs and steps from msdb history, include retries and cancellations, and account for local times and trimmed records.

Read More
Previous 1 … 205 206 207 208 209 210 211 … 420 Next
  • Books
  • Testimonials
  • Privacy Policy

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