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 - Rename Database to New Name Using Stored Procedure by Changing to Single User Mode

SQL SERVER – Rename Database to New Name Using Stored Procedure by Changing to Single User Mode

September 19, 2007
Pinal Dave
SQL Tips and Tricks
Database, SQL Scripts, SQL Stored Procedure

How we rename database copies on our development server: set it to single user mode, run sp_renamedb, then set it back. The file names do not change.

Read More
A pot of soup on a stove beside a counter of bowls already ladled, a hand choosing between them.

Scaling Out Read Queries

September 18, 2007
Pinal Dave
SQL Performance
AlwaysOn, Query Store, SQL Cache, SQL Performance, SQL Server

Scaling out read queries uses replicas, caches, and routing with measured freshness and operating cost; learn when each path fits.

Read More
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
Envelopes dropping through a letter slot into a large basket

Designing Tables for High Insert Rates

September 17, 2007
Pinal Dave
SQL Performance
Clustered Index, SQL Index, SQL Server, Table Partitioning, Transaction Log

High insert rates depend on key choice, row width, index count, and retention design; learn a practical SQL Server table layout for sustained writes.

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
A narrow post office service window revealing only a few wooden pigeonholes of the sorting wall behind it.

Querying Active Directory From SQL Server

September 16, 2007
Pinal Dave
SQL Tips and Tricks
Linked Server, SQL Domain Controller, SQL Server, SQL Server Security

Querying active directory through an ADSI linked server can answer narrow questions, but its limits favor staged data for repeatable work.

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
A row of rain gauges holding different amounts of water

Grouping Dates Into Buckets With DATE_BUCKET

September 14, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Server, SQL Server 2022

DATE_BUCKET groups timestamps into hourly, weekly, and custom intervals, with an origin that determines where every boundary lands.

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
Previous 1 … 556 557 558 559 560 561 562 … 590 Next
  • Books
  • Testimonials
  • Privacy Policy

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