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
A pepper mill holds peppercorns above its mechanism with an unsuitable pebble caught before grinding

Second-Order SQL Injection: When Stored Data Becomes Code

May 30, 2012
Pinal Dave
SQL Tips and Tricks
Dynamic SQL, SQL Server Security, SQL String, SQL Variable

A safe insert does not make the saved value safe forever. Here is how stored text turns into code later, and the plain fix.

Read More
An adjustable curtain rod aligns repeated mounting holes before the curtains are fitted

Filling Template Parameters in SSMS With Ctrl+Shift+M

May 12, 2012
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server Management Studio, SQL Shortcut, SQL Variable

Template parameters save you from typing one value in four places, but they only paste text. Here is what that means in practice.

Read More
A pottery rib shapes a clay vessel beside a trimmed clay strip and a newly attached clay handle

XML modify(): Inserting, Replacing and Deleting Nodes

May 11, 2012
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Table Operation, SQL Variable, SQL XML

The modify() method edits XML in place, but a path that matches nothing changes nothing and says nothing. Here is how to stay in control.

Read More
A pastry crimper seals a pie edge through its fixed toothed shape beside unused decorative cutters

Dynamic ORDER BY Without Injection: Whitelisting Sort Columns

May 9, 2012
Pinal Dave
SQL Tips and Tricks
Dynamic SQL, SQL Order By, SQL Server Security, SQL Variable

Parameters cannot name a column, so grids end up gluing text into SQL. Here is the approved-list pattern that keeps the sort safe.

Read More
Gouache painting of a coiled measuring ribbon beside two growing stacks of blocks on a craft table.

Compound Assignment Operators in SQL Server: SQL in Sixty Seconds #009

March 28, 2012
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Operator, SQL Scripts, SQL Variable

Compound assignment operators such as += and *= combine an operation with an assignment in T-SQL. The tests here run all eight operators on SQL Server 2025, and show how NULL, integer division, overflow, truncation and precedence change the result.

Read More
Gouache painting of illustrated cards travelling between two wooden trays on a looping ribbon beside a red stop block.

Table Variables and Transactions in SQL Server: SQL in Sixty Seconds #007

March 21, 2012
Pinal Dave
SQL Video
SQL in Sixty Seconds, SQL Transactions, SQL Variable, Temp Table

Table variables and transactions do not mix the way temporary tables do, because a ROLLBACK leaves the rows in a table variable. The tests here cover a full rollback, a savepoint, a failed statement and a logging pattern, all on SQL Server 2025.

Read More
Gouache painting of a stone moving from an open envelope into a fitted compartment in a wooden sorting tray.

Declare and Initialize Variables in SQL Server: SQL in Sixty Seconds #003

February 22, 2012
Pinal Dave
SQL Video
SQL Datatype, SQL in Sixty Seconds, SQL Scripts, SQL Variable

To declare and initialize variables in one statement, give each variable a type and a starting value in the same DECLARE. The tests here show the NULL default, a loop that does not reset an uninitialized variable, and the one character varchar trap on SQL Server 2025.

Read More
Previous 1 2 3 4 Next
  • Books
  • Testimonials
  • Privacy Policy

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