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
A potato spiralizer preserving a fine ribbon beside coarse whole potato pieces

AVG of an Integer Column Returns an Integer: Getting Decimals Back

October 3, 2019
Pinal Dave
SQL Tips and Tricks
Computed Column, SQL Column, SQL Server

The dashboard says the average is 1 when everyone can see it is 1.5. Here is why AVG does that and the one-line fix.

Read More
Gouache painting of three flower stems clipped in one cut by vermilion shears on a florist's bench

Drop Multiple Columns in One ALTER TABLE Statement

October 2, 2019
Pinal Dave
SQL Tips and Tricks
SQL Column, SQL Scripts, SQL Table Operation

To drop multiple columns, list them after one DROP COLUMN in one ALTER TABLE statement. This post tests the syntax on a table with a default, a check constraint and an index, shows the error that a dependent object causes and drops the constraints and columns together. It also explains why the disk space doesn’t return until a rebuild.

Read More
Gouache painting of a still music room with a small vermilion music box beginning to turn on the bench

Idle CPU Condition in SQL Server Agent: How It Works

September 28, 2019
Pinal Dave
SQL Tips and Tricks
SQL CPU, SQL Server Agent, SQL Server Management Studio

The idle CPU condition tells SQL Server Agent when the CPUs are quiet enough to start a job. This post shows where to set it, how the two numbers work and how to create the schedule. It also reads the CPU history of your server in T-SQL, so you can choose values that the server can actually meet.

Read More
alias

SQL SERVER – Strange Error Related to Alias

September 27, 2019
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server

They immediately paid for Comprehensive Database Performance Health Check and we got online to look at their strange error related to alias.

Read More
SQL SERVER - Unable to Start SQL Server Service or Connect After Incorrectly Setting Max Server Memory to a Low Value

SQL SERVER – Unable to Start SQL Server Service or Connect After Incorrectly Setting Max Server Memory to a Low Value

September 26, 2019
Pinal Dave
SQL Tips and Tricks
SQL Connection, SQL Error Messages, SQL Memory, SQL Scripts, SQL Server, Starting SQL

After incorrectly setting max server memory to 14 MB instead of 145000, a client could not start SQL Server. Here is how we got it back online.

Read More
A shepherd seen from behind counting sheep one by one through a half-open field gate, a red crook against the post.

ROWCOUNT_BIG and @@ROWCOUNT: Checking What a Statement Changed

September 25, 2019
Pinal Dave
SQL Tips and Tricks
Output Clause, SQL Function, SQL Scripts, SQL Server, SQL Trigger

Capture ROWCOUNT_BIG immediately after a change, validate expected counts, and handle NOCOUNT, triggers, and MERGE without stale values.

Read More
Gouache painting of a vegetable bed divided into five sections with a vermilion watering can on one divider

Get Partition Info in SQL Server: Rows and Boundaries

September 24, 2019
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL System Table, Table Partitioning

To get partition info in SQL Server, join sys.partitions to the partition scheme, function and filegroup views. This post builds a small partitioned table, lists every partition with its boundaries, row count and filegroup, and shows how to find the partition for a value. It also lists the tables that have more than one partition.

Read More
Previous 1 … 68 69 70 71 72 73 74 … 570 Next
  • Books
  • Testimonials
  • Privacy Policy

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