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 corridor of wooden gym lockers with small brass number plates, receding into soft light.

MySQL – Generating Row Number for Each Row Using Variable

March 8, 2014
Pinal Dave
SQL Tips and Tricks
MySQL, Ranking Functions, SQL Scripts

MySQL has no ROW_NUMBER() function like SQL Server. Here are two methods for generating row number values for each row with a variable in a SELECT statement.

Read More
SQL SERVER - Retrieve Maximum Length of Object Name with sp_server_info

SQL SERVER – Retrieve Maximum Length of Object Name with sp_server_info

March 7, 2014
Pinal Dave
SQL Tips and Tricks
SQL Stored Procedure

How long can a table name be in SQL Server? The answer is 128, and you can confirm it yourself by running the stored procedure sp_server_info.

Read More
A cannoli forming tube beside a filled pastry shell and an empty matching shell

Sending an HTML Table by Email With sp_send_dbmail

March 5, 2014
Pinal Dave
SQL Tips and Tricks
Database Mail, HTML, SQL XML

Turn a wall of report text into a clean table. FOR XML PATH escapes your data, and a few small tricks handle NULL values and empty days.

Read More
A chalk line reel beside a persistent blue mark and cord ready for another snap

The Outbox Table: Publishing Changes Reliably From a Transaction

March 4, 2014
Pinal Dave
SQL Tips and Tricks
Output Clause, SQL Lock, SQL Transactions

Orders commit and the message vanishes? Save both in one transaction, then let a worker claim, send and retry with a lease. Duplicates are still possible.

Read More
A kitchen drawer crammed with rolled canvases so full it cannot close

Storing Images in varbinary(max): Size, Reads and Backups

March 3, 2014
Pinal Dave
SQL Tips and Tricks
SQL Backup and Restore, SQL Data Storage, SQL Datatype, SQL Server

Store images in varbinary(max), read file bytes with OPENROWSET, inspect LOB allocation, and evaluate backup and retrieval costs.

Read More
Displaying table and columns for SQL query.

SQL SERVER – Listing Primary Key of Table with Stored Procedure sp_pkeys

March 2, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

Here is how to list the primary key of a table with the stored procedure sp_pkeys, a follow up to my earlier post on sp_fkeys.

Read More
Sp_fkeys output window.

SQL SERVER – Listing Foreign Key Relationships of Table with Stored Procedure sp_fkeys

March 1, 2014
Pinal Dave
SQL Tips and Tricks
SQL Constraint and Keys

A quick trick to list all the foreign key relationships of a table with the stored procedure sp_fkeys, with a sample script on AdventureWorks2012.

Read More
Previous 1 … 288 289 290 291 292 293 294 … 572 Next
  • Books
  • Testimonials
  • Privacy Policy

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