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 - How to Retrieve TOP and BOTTOM Rows Together using T-SQL

SQL SERVER – How to Retrieve TOP and BOTTOM Rows Together using T-SQL

March 2, 2008
Pinal Dave
SQL Tips and Tricks
SQL Error Messages, SQL Function, SQL Joins, SQL Scripts, SQL Server

Need TOP 1 and BOTTOM 1 in one result? UNION fails with two ORDER BY clauses. Here is a simple T-SQL way to retrieve TOP and BOTTOM Rows together.

Read More
SQL SERVER - Find All The User Defined Functions (UDF) - Part 2

SQL SERVER – Find All The User Defined Functions (UDF) – Part 2

February 22, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

Madhivanan shared another way to find all the user defined functions in a database, using information_schema.routines. Here is his short script.

Read More
SQL SERVER - UDF to Return a Calendar for Any Date for Any Year.

SQL SERVER – UDF to Return a Calendar for Any Date for Any Year

February 20, 2008
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts

Reader Dan Golden built on my weekly calendar function to create a UDF to return a calendar for any date for any year. I fixed a small first and last week bug.

Read More
SQL SERVER - Find All The User Defined Functions (UDF) in a Database

SQL SERVER – Find All The User Defined Functions (UDF) in a Database

February 2, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

A very simple script that lists all the User Defined Functions in a database, with schema name and type, by reading sys.objects in SQL Server.

Read More
SQL SERVER - Introduction to Statistical Functions - VAR, STDEVP, STDEV, VARP

SQL SERVER – Introduction to Statistical Functions – VAR, STDEVP, STDEV, VARP

January 20, 2008
Pinal Dave
SQL Tips and Tricks
SQL Function

VAR, STDEVP, STDEV and VARP are statistical functions that also fit the aggregate function definition. A quick AdventureWorks example shows all four.

Read More
SQL SERVER - Introduction to Aggregate Functions

SQL SERVER – Introduction to Aggregate Functions

January 19, 2008
Pinal Dave
SQL Interview Questions and Answers
SQL Function

What are Aggregate Functions in SQL Server? The Books Online definition, the full list, and the NULL and GROUP BY rules that candidates often miss.

Read More
SQL SERVER - Remove Duplicate Characters From a String

SQL SERVER – Remove Duplicate Characters From a String

December 30, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL String

A follow up to my Remove Duplicate Chars From String post: Madhivanan shows how to remove duplicate characters from a string with a Number table approach.

Read More
Previous 1 … 41 42 43 44 45 46 47 … 55 Next
  • Books
  • Testimonials
  • Privacy Policy

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