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
SQL SERVER - How to ALTER CONSTRAINT

SQL SERVER – How to ALTER CONSTRAINT

April 24, 2011
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

Can you ALTER CONSTRAINT in SQL Server? No. The only way to change a constraint is to drop it and create it again, and here is the script for that.

Read More
Three distinct stamps match three clay impressions beside a separate blank fallback tile.

SQL SERVER – How to Use Decode in SQL Server?

April 23, 2011
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server

CASE expresses the DECODE mapping in this SQL Server example. I keep the named matches and default value explicit.

Read More
SQL SERVER - Potential Bottlenecks for Performance

SQL SERVER – Potential Bottlenecks for Performance

April 22, 2011
Pinal Dave
SQL Tips and Tricks

At GIDS I was asked to name potential bottlenecks for performance. My old college list still holds: CPU, RAM, hard disk, network and application code.

Read More
SQL server error message dialog.

SQL SERVER – Prevent Constraint to Allow NULL

April 21, 2011
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts

Why does a CHECK constraint allow NULL? A reader thought it was a bug. I show why it happens and how to write the constraint so NULL is rejected too.

Read More
A jigsaw puzzle with pieces sorted into groups before being fitted together

Common Table Expressions for Readability

April 20, 2011
Pinal Dave
SQL Tips and Tricks
CTE, SQL Coding Standards, SQL Server, Temp Table

Common table expressions for readability name query steps and support recursion, but they do not promise cached intermediate results.

Read More
Two overlapping pale ceramic tiles beside a terracotta slab and blue and sage stones.

geometry STDistance: Measure the Closest Points of Two Shapes

April 19, 2011
Pinal Dave
SQL Tips and Tricks
Spatial Database, SQL Function, SQL Scripts, SQL Server

geometry STDistance measures the shortest distance between points belonging to two represented shapes. I compare an interior gap with an endpoint gap. Intersecting shapes provide a useful zero-distance case.

Read More
Hands tipping a large milk churn over a small teacup, milk flooding the table, a tiny cream jug unused

SELECT * in Production Code: The Hidden Costs

April 18, 2011
Pinal Dave
SQL Performance
SQL Coding Standards, SQL Index, SQL Server, SQL View

See the real costs of SELECT * in production code: lost covering indexes, lookups, stale view metadata, broken inserts and wider results.

Read More
Previous 1 … 596 597 598 599 600 601 602 … 841 Next
  • Books
  • Testimonials
  • Privacy Policy

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