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 one jar of buttons being topped up by a small red scoop while spare empty jars stand unused

Compound Assignment Operators in T-SQL with Simple Examples

June 5, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Operator, SQL Scripts

Compound Assignment Operators let T-SQL do a calculation and an assignment in one step, so SET @Stock -= 2 replaces SET @Stock = @Stock – 2. This post tests all eight operators on SQL Server 2025 with a small garden center inventory. It also shows integer division, NULL, string and flag examples, and where the shorthand does not help.

Read More
SQL SERVER - Create a Comma Delimited List Using SELECT Clause From Table Column

SQL SERVER – Create a Comma Delimited List Using SELECT Clause From Table Column

June 4, 2008
Pinal Dave
SQL Tips and Tricks
CSV, Database, SQL Function, SQL Scripts, SQL Server, SQL Stored Procedure

I received following question in email : How to create a comma delimited list using SELECT clause from table column?

Read More
SELECT DISTINCT ResultDistinct.

SQL SERVER – Example of DISTINCT in Aggregate Functions

June 3, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Does DISTINCT in Aggregate Functions make a difference? Yes. A quick AdventureWorks example compares SUM(DISTINCT ReorderPoint) with a plain SUM.

Read More
SQL SERVER - Order Of Column In Index

SQL SERVER – Order Of Column In Index

June 2, 2008
Pinal Dave
SQL Performance
SQL Index, SQL Joins, SQL Scripts

Adding more columns does not make an index better. The order of column in index matters most, since an index is used only when its first column is in the query.

Read More
SQL SERVER - SQL SERVER - UDF - Get the Day of the Week Function - Part 4

SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function Part 4

June 1, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

In Day of the Week Function Part 4, I answer why I write a UDF when DATENAME exists (I just like it) and show the one line DATENAME version.

Read More
An oak supply tray has an empty compartment beside its standard fitting, while existing filled compartments remain untouched.

SQL SERVER – Create Default Constraint Over Table Column

May 31, 2008
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Server

A DEFAULT constraint supplies a value when an INSERT omits the column. I test omitted values separately from explicit NULL.

Read More
SQLAuthority News - 3 Million Readers and Continuing Journey

SQLAuthority News – 3 Million Readers and Continuing Journey

May 30, 2008
Pinal Dave
SQLAuthority News
Database, DBA, Software Development

SQLAuthority passed 3 Million readers. Thank you for your active participation. Here are my best and favorite articles if you want to keep reading.

Read More
SQL Server Unpivot Table.

SQL SERVER – UNPIVOT Table Example

May 29, 2008
Pinal Dave
SQL Tips and Tricks
PIVOT and UNPIVOT, SQL Function, SQL Scripts

UNPIVOT Table is the reverse of PIVOT. This AdventureWorks example turns state columns back into rows, and shows why the detail rows do not return.

Read More
A gardener seen from behind adjusting a greenhouse roof vent, with a shade cloth, heater and healthy seedlings.

Windows Settings That Affect SQL Server

May 28, 2008
Pinal Dave
SQL Tips and Tricks
DBA, SQL Memory, SQL Server Configuration, Windows

Windows settings can influence SQL Server CPU speed, file growth, memory stability, and security scanning; learn what to inspect and validate.

Read More
SQL SERVER - SQL SERVER - UDF - Get the Day of the Week Function - Part 3

SQL SERVER – SQL SERVER – UDF – Get the Day of the Week Function – Part 3

May 27, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Nanda Kumar improved the UDF to get the day of the week: it now uses the date you pass in instead of GETDATE() and handles Saturday correctly.

Read More
Previous 1 … 528 529 530 531 532 533 534 … 589 Next
  • Books
  • Testimonials
  • Privacy Policy

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