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
Sep23

SQL SERVER – Cross Database Queries Not Allowed in Indexed View – Limitation of the View 7

Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL View
6 Comments

An indexed view needs WITH SCHEMABINDING, and that rules out cross database queries. Limitation of the view 7 walks through it with two test databases.

Continue Reading
Sep22

SQL SERVER – UNION Not Allowed but OR Allowed in Index View – Limitation of the View 6

Pinal Dave
SQL Tips and Tricks
SQL Index, SQL Scripts, SQL Union clause, SQL View
13 Comments

UNION not allowed in an indexed view can surprise you. Limitation of the view 6 shows the script that fails and how the OR operator is allowed instead.

Continue Reading
Sep21

SQL SERVER – COUNT(*) Not Allowed but COUNT_BIG(*) Allowed – Limitation of the View 5

Pinal Dave
SQL Tips and Tricks
SQL Index, SQL Scripts, SQL View
7 Comments

A view with COUNT(*) cannot get a clustered index, but switch to COUNT_BIG and it works. Limitation of the view 5, shown with a simple tempdb example.

Continue Reading
Sep20

SQL SERVER – How to Stop Growing Log File Too Big

Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Scripts
48 Comments

A client kept truncating the transaction log because of a growing log file. I explain why that is risky and share two better options, starting with Simple recovery.

Continue Reading
Sep19

Finding the Nearest Location With a Spatial Index

Pinal Dave
SQL Performance
Execution Plan, Spatial Database, SQL Index, SQL Server
3 Comments

A nearest location query in SQL Server needs TOP, STDistance in WHERE and ORDER BY, matching SRIDs, and a checked spatial plan.

Continue Reading
Sep18

Percent of Total With SUM() OVER() in One Query

Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Reports, SQL Scripts, SQL Server
No Comments

Calculate percent of total with SUM() OVER(), group and running shares, safe numeric division, and checks for zero totals.

Continue Reading
Sep17

REPLACE With COLLATE: Choose Case Matching Explicitly

Pinal Dave
SQL Tips and Tricks
SQL Collation, SQL Function, SQL Server
No Comments

REPLACE with COLLATE controls which substrings match. Preview case-dependent results before applying a text replacement policy.

Continue Reading
Previous 1 … 633 634 635 636 637 638 639 … 846 Next

SQL Server slow? Let's fix it together in about four hours.

Pinal Dave

In my Comprehensive Database Performance Health Check, you share your screen, I guide you, and we fix your biggest performance troublemakers. No passwords. No remote access.

You keep every script, and the know-how to fix it yourself next time.

Want your whole team to learn it?

My Practical Workshop has no PowerPoint, just live demos. My AI Enablement Workshop shows your team where AI saves hours, and where it quietly costs them.

Over 400 customers have worked with me this way, and not one shared a password. See all consulting options.


Who We Are

Pinal Dave is an SQL Server Performance Tuning Expert and independent consultant with over 24 years of hands-on experience. He holds a Masters of Science degree and numerous database certifications.

Pinal has authored 19 books and 125 Pluralsight courses. To freely share his knowledge and help others build their expertise, Pinal has also written more than 5,800 database tech articles on his blog at https://blog.sqlauthority.com.

Pinal is also a CrossFit Level 1 Trainer (CF-L1) and CrossFit Level 2 Trainer (CF-L2).


Nupur Dave is a social media enthusiast and an independent consultant. She primarily focuses on the database domain, helping clients build short and long-term multi-channel campaigns to drive leads for their sales pipeline.


Shaivi Pinalkumar Dave is a book author and a women’s artistic gymnast.

  • Books
  • Testimonials
  • Privacy Policy

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