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
column exists

SQL SERVER – Checking If a Column Exists in a Table

August 24, 2023
Pinal Dave
SQL Tips and Tricks
Schema, SQL Column, SQL Table Operation, System Object

Let us see a script that will help check if a Column Exists in a Table. One of the common tasks that developers deal with when working on database-related projects

Read More
Gouache painting of a wooden table with a bowl of pears in front of a leaning mirror, with a small vermilion magnifying glass between them

Table or View in SQL Server: Check With OBJECTPROPERTY

March 24, 2021
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Table Operation, SQL View, System Object

To settle table or view in SQL Server, ask OBJECTPROPERTY. This post builds a table, a view, a synonym and a procedure, and reads the answers for each. It also shows a trap with other databases and a catalog query for every object.

Read More
Detach and Drop

SQL SERVER – Offline, Detach and Drop – Differences – SQL in Sixty Seconds #103

August 18, 2020
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Scripts, SQL Server, SQL Server Management Studio, System Object

if I can help them understand the difference between database status like Offline, Detach and Drop. It was very important to differences.

Read More
Gouache painting of a crowd of spinning wind-up toys on a shelf with one vermilion top

Background Job Queue: List Active Jobs and Kill a Stats Job

July 15, 2020
Pinal Dave
SQL Performance
SQL DMV, SQL Scripts, SQL Statistics, System Object

The background job queue holds work that SQL Server runs outside your queries, such as asynchronous statistics updates. This post lists the active jobs, reads the queue counters, catches a real statistics job in a demo and kills it with KILL STATS JOB. It also corrects a common mix-up: the command takes the job ID, not the session ID.

Read More
Gouache painting of a row of watering cans on a bench with one leaking vermilion can

IO Stalls by Database File: Find the File to Move

August 21, 2019
Pinal Dave
SQL Performance
Disk, SQL DMV, SQL Scripts, System Object

IO stalls measure how long SQL Server waited for the disk, file by file. This post ranks the files of a demo database by stall time, measures a workload with two snapshots, lists the busiest files of a whole instance, and explains how to pick the one file that belongs on the new drive.

Read More
Gouache painting of a wall of small drawers with one pulled open showing a vermilion key

Show Primary Key of a Table in SQL Server With sp_pkeys

August 14, 2019
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Stored Procedure, System Object

To show primary key columns for one table, call sp_pkeys with the table name. This post builds a small demo database, reads a single column and a composite key, and handles schemas and errors. It also lists every key in a database with one catalog query.

Read More
CLONEDATABASE

SQL SERVER – DBCC CLONEDATABASE Error: Cannot Insert Duplicate Key Row In Object ‘sys.sysschobjs’ With Unique Index ‘clst’.

July 4, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server, SQL Server DBCC, SQL System Table, System Database, System Object

Learn how to fix: Cannot insert a duplicate key row in object ‘sys.sysschobjs’ with unique index ‘clst’ while using DBCC CLONEDATABASE.

Read More
1 2 3 Next
  • Books
  • Testimonials
  • Privacy Policy

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