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 - UDF - Validate Positive Integer Function - Validate Natural Integer Function

SQL SERVER – UDF – Validate Positive Integer Function – Validate Natural Integer Function

September 18, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

A Jr. DBA at my company changed my integer check so it accepts only a positive integer. I share his udf_IsNatural function with a few test values.

Read More
SQL SERVER - Difference Between UPDATE and UPDATE()

SQL SERVER – Difference Between UPDATE and UPDATE() in Triggers

September 17, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

UPDATE changes rows in a table or view, while UPDATE() in triggers tells you if a column was part of an INSERT or UPDATE. Here is the difference.

Read More
SQL SERVER - 2005 - List All The Constraint of Database - Find Primary Key and Foreign Key Constraint in Database

SQL SERVER – 2005 – List All The Constraint of Database – Find Primary Key and Foreign Key Constraint in Database

September 16, 2007
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL System Table

A simple script from my archive lists all constraints from sys.objects, so you can check each foreign key and primary key constraint in database tables.

Read More
Neatly arranged plain wooden building pieces beside a pencil on a quiet worktable.

Writing T-SQL Somebody Else Can Maintain

September 15, 2007
Pinal Dave
SQL Tips and Tricks
Best Practices, Database, SQL Scripts, SQL Server

Write maintainable T-SQL with clear names, explicit results, focused procedures, and comments that explain the business reason behind the code.

Read More
SQL SERVER - Difference Between EXEC and EXECUTE vs EXEC() - Use EXEC/EXECUTE for SP always

SQL SERVER – Difference Between EXEC and EXECUTE vs EXEC() – Use EXEC/EXECUTE for SP always

September 13, 2007
Pinal Dave
SQL Tips and Tricks
DBA, SQL Cursor, SQL Scripts, SQL Stored Procedure

What is the difference between EXEC and EXECUTE? None. The real difference is EXEC vs EXEC(), and I show why EXEC belongs before every stored procedure call.

Read More
Two glass jars stand side by side, one empty and one holding red seeds.

COUNT_BIG: Count Rows and Non-NULL Values as bigint

September 12, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL NULL, SQL Scripts, SQL Server

COUNT_BIG helps me name the counting rule before reading the result. Compare rows, supplied values and distinct readings. Then check empty results and the bigint return type.

Read More
Three empty rectangular ceramic dishes in a wooden tray beside a blank cream folio and vermilion ribbon.

FORMATMESSAGE: Build a Message Without Raising an Error

September 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

FORMATMESSAGE returns formatted text without raising an error. Match placeholders to typed arguments and keep formatting separate from control flow.

Read More
Previous 1 … 333 334 335 336 337 338 339 … 365 Next
  • Books
  • Testimonials
  • Privacy Policy

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