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 - Return Specific Row to at the Bottom of the Resultset - T-SQL Script

SQL SERVER – Return Specific Row to at the Bottom of the Resultset – T-SQL Script

April 23, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server

How do I return a few chosen rows at the bottom of the entire resultset, in my own order? A T-SQL script on AdventureWorks shows how to do it.

Read More
A hand topping cupcakes with red raspberries, the last cupcake left plain on the tray.

CROSS APPLY and OUTER APPLY in Everyday Queries

April 13, 2013
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Joins, SQL Scripts, SQL Server

Use CROSS APPLY and OUTER APPLY for per-row functions, reusable expressions, VALUES unpivoting, DMV text, plans, and latest rows.

Read More
A solid slate-colored rectangular tile beside a sage triangular tile, a loose cream cord and a red pebble.

geometry STArea: Measure the Polygon Interior

April 11, 2013
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts, SQL Server

geometry STArea measures polygon interior rather than its outline. These local planar shapes show equal areas with different perimeters, a hole subtraction and zero-area instances.

Read More
SQL SERVER - Fix : Error: 217 Implicit conversion from data type datetime to int is not allowed.

SQL SERVER – Fix : Error: 257 Implicit conversion from data type datetime to int is not allowed.

April 9, 2013
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Scripts, SQL Server

Implicit conversion from data type datetime to int is not allowed. I hit this error with ISNULL and a date, and the fix is right in the message: use CONVERT.

Read More
SQL SERVER - The procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.

SQL SERVER – The procedure attempted to return a status of NULL, which is not allowed. A status of 0 will be returned instead.

April 8, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Stored Procedure

Why does SQL Server say a procedure attempted to return a status of NULL and returns 0 instead? A reader asked on Facebook, and I explain what it means.

Read More
Gouache painting of a wooden chute carrying a red apple from one crate of green apples into another

How to Pass Stored Procedure Result to Another Procedure in SQL Server

April 7, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL Stored Procedure, SQL Variable

To pass stored procedure result values from one procedure to another, use an OUTPUT parameter. This post tests RETURN codes, INSERT … EXEC and table-valued parameters on a small order demo. It also shows the errors each method raises and when a function is the better tool.

Read More
SQL SERVER - Group by Rows and Columns using XML PATH - Efficient Concating Trick

SQL SERVER – Group by Rows and Columns using XML PATH – Efficient Concating Trick

April 5, 2013
Pinal Dave
SQL Tips and Tricks
SQL Scripts, SQL Server, SQL String, SQL XML

A reader wanted students and courses grouped by course and instructor in a single row. Here is a simple concatenation trick with XML PATH that does it.

Read More
Previous 1 … 188 189 190 191 192 193 194 … 363 Next
  • Books
  • Testimonials
  • Privacy Policy

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