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
Gouache painting of a small red-tabbed group of cards separated from a larger file drawer by a brass guide.

Replace SELECT * with Column Names in SQL Server: SQL in Sixty Seconds #017

June 6, 2012
Pinal Dave
SQL Video
SQL Coding Standards, SQL Column, SQL in Sixty Seconds, SQL Server Management Studio, SQL View

Replace SELECT * with the columns your application needs. The tests here show a query that read 4 pages instead of 64, a view that missed a new column, and two errors that appear when a table changes, all on SQL Server 2025.

Read More
A wooden board with rows of small square openings and an oversized red piece leaning against it that cannot fit.

Indexed View Restrictions Quiz: Which Rule Blocks the Index?

January 8, 2012
Pinal Dave
SQL Puzzle
Clustered Index, SQL Error Messages, SQL Index, SQL Joins, SQL View

This Indexed View Restrictions Quiz asks which rule stops a unique clustered index on a view. The answer is the LEFT OUTER JOIN. A tested script shows the error, the working view, and what happens when each required rule is missing.

Read More
A wooden door with three brass bells hanging on cords, each with a small red tassel.

Types of Triggers Quiz: Which Trigger Can Fire on a View?

January 3, 2012
Pinal Dave
SQL Puzzle
SQL Error Messages, SQL Table Operation, SQL Trigger, SQL View

This Types of Triggers Quiz asks which trigger you can put on a view that joins two tables. The answer is INSTEAD OF INSERT. A tested script shows the error an AFTER trigger gives and how the working trigger splits one insert into two tables.

Read More
A jar of ground coffee with a red scoop, the hand grinder unused behind it

Indexed Views: When the Faster Reads Are Worth It

September 26, 2011
Pinal Dave
SQL Performance
SQL Index, SQL Performance, SQL Server, SQL View

Evaluate indexed views by building a sales summary, comparing read savings with write maintenance, and using NOEXPAND where required.

Read More
A function that returns a table: GetCategoryProducts takes a category, returns Assam Tea, Green Tea and Chamomile for Tea, and Cardamom, Cumin and Turmeric for Spice

Function That Returns a Table: Table Valued Functions

August 26, 2011
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL View

A function that returns a table works like a view that takes parameters. This post builds inline table valued functions over a small product table, compares them with a view and a scalar function, uses them with CROSS APPLY, and shows the two common mistakes with parentheses. Every result comes from SQL Server 2025.

Read More
Three states of a view of invoices over 2,000: five rows at the start, five rows after one update that subtracts 150, and four rows after a second run, with invoice 1 at 1,900 in the table but missing from the view

WITH CHECK OPTION in SQL Server: Stop Rows Leaving a View

August 24, 2011
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Trigger, SQL View

WITH CHECK OPTION stops a change made through a view from pushing a row out of that view. This post builds a view of large invoices, shows an update and an insert that make rows vanish, adds the option to block both with Msg 550, and compares it with a trigger. Every result comes from SQL Server 2025.

Read More
Three rules for creating a view with the error each one raises: name every column (Msg 4511), keep column names unique (Msg 4506), and leave out ORDER BY (Msg 1033)

Create a View in SQL Server: Column Rules and Encryption

August 23, 2011
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server Encryption, SQL View

To create a view in SQL Server you save a SELECT statement under a name. This post builds a view over a small donations table, shows the three rules behind the most common view errors, and tests four ways to read a view’s code before and after WITH ENCRYPTION. Every result comes from SQL Server 2025.

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

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