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 a wooden kitchen pass-through with an empty tray on one side and a tray with a teapot coming back, a vermilion towel on the sill.

MySQL OUT Parameter: IN, OUT and INOUT in Stored Procedures

October 14, 2019
Pinal Dave
SQL Tips and Tricks
MariaDB, MySQL, SQL Scripts, SQL Stored Procedure

A MySQL OUT parameter lets a stored procedure hand a value back to the caller through a variable. This post tests IN, OUT and INOUT on a small table, shows the error you get when you pass a literal, and compares the syntax with SQL Server.

Read More
Gouache painting of a wall of small drawers with one pulled open showing a vermilion key

Show Primary Key of a Table in SQL Server With sp_pkeys

August 14, 2019
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys, SQL Scripts, SQL Stored Procedure, System Object

To show primary key columns for one table, call sp_pkeys with the table name. This post builds a small demo database, reads a single column and a composite key, and handles schemas and errors. It also lists every key in a database with one catalog query.

Read More
Gouache painting of a meadow with one wide worn path and a vermilion stile at its start

Frequently Run Stored Procedures: Find Them in the Cache

August 5, 2019
Pinal Dave
SQL Tips and Tricks
SQL Cache, SQL CPU, SQL Scripts, SQL Stored Procedure

Frequently run stored procedures leave an execution count in the plan cache. A tested demo ranks three procedures by count, reads and calls per minute. It also shows what the cache forgets and when to use Query Store instead.

Read More
A small boat leaves a visible wake beyond its old mooring

How to Write in Text File from T-SQL in SQL Server? – Interview Question of the Week #236

August 4, 2019
Pinal Dave
SQL Interview Questions and Answers
SQL Scripts, SQL Server, SQL Server Configuration, SQL Stored Procedure, SQL String

Question: How to Write in Text File from T-SQL in SQL Server?
The question above was actually asked in an interview and also was not asked in the same word.

Read More
Gouache painting of a clay pot beside the vermilion wooden form it was shaped around

Compiled Parameter Values in SQL Server: Read Them From the Cache

May 7, 2019
Pinal Dave
SQL Performance
Execution Plan, SQL Cache, SQL DMV, SQL Stored Procedure

Compiled parameter values show which value SQL Server used when it built a cached plan. This post reads them from the plan cache with one query, then shows how the first caller shapes the plan for everyone after. It ends with the usual ways to break that link.

Read More
A blank wooden fingerpost on a moor, one arm pointing to the stone footings of a vanished cottage

Finding Procedures That Reference Databases That No Longer Exist

March 13, 2019
Pinal Dave
SQL Tips and Tricks
DBA, Dynamic SQL, SQL Dependency, SQL Stored Procedure

Find procedures that reference databases missing from the instance, retain review coverage, and check dynamic SQL and synonyms separately.

Read More
Gouache painting of a slate blue jug on a small wooden pouring stand pouring glaze into a vermilion jar

Dynamic SQL Result Into a Variable with sp_executesql

November 20, 2018
Pinal Dave
SQL Tips and Tricks
Dynamic SQL, SQL Scripts, SQL Stored Procedure, SQL Variable

To get a dynamic SQL result into a variable, use sp_executesql with an OUTPUT parameter. This post tests the pattern on a small demo, explains Msg 214 and shows counts, JSON, new identity values and generic table names. It also covers INSERT with EXEC for result sets.

Read More
Previous 1 … 5 6 7 8 9 10 11 … 36 Next
  • Books
  • Testimonials
  • Privacy Policy

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