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 - 2005 - Use of Non-deterministic Function in UDF - Find Day Difference Between Any Date and Today

SQL SERVER – 2005 – Use of Non-deterministic Function in UDF – Find Day Difference Between Any Date and Today

August 23, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Error Messages, SQL Function, SQL Scripts

I always thought a non-deterministic function was not allowed in a UDF, but GETDATE() works in SQL Server 2005. My UDF finds the day difference from today.

Read More
A furnished room beside the same room drawn as an empty blueprint, showing shape without contents.

SQL SERVER – 2005 – Create Script to Copy Database Schema and All The Objects – Stored Procedure, Functions, Triggers, Tables, Views, Constraints and All Other Database Objects

August 21, 2007
Pinal Dave
SQL Tips and Tricks
Database, SQL Backup and Restore, SQL Constraint and Keys, SQL Cursor, SQL Download, SQL Function, SQL Index, SQL Scripts, SQL Stored Procedure, SQL Trigger

A step by step tutorial to create a T-SQL script that can copy database schema and all objects, like stored procedures, functions, triggers, tables and views.

Read More
A paper calendar with the last day of the month circled in red.

SQL SERVER – Find Last Day of Any Month – Current Previous Next

August 18, 2007
Pinal Dave
SQL Tips and Tricks
SQL DateTime, SQL Function, SQL Scripts, SQL Utility

Find the last day of any month with DATEADD and DATEDIFF. One script returns the last day of the previous, current and next month in SQL Server.

Read More
A wooden coin-sorting tray with coins stacked by size, one large coin stuck in the wrong channel, a bag of coins beside it.

GROUP BY Done Right

August 14, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Group By, SQL Joins, SQL NULL, SQL Server

GROUP BY Done Right separates row filters from group filters, handles NULL groups, and avoids totals inflated by careless joins.

Read More
SQL SERVER - UDF - Validate Integer Function

SQL SERVER – UDF – Validate Integer Function

August 11, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts

ISNUMERIC() returns 1 for plus, minus and currency signs, so it is not a safe check. I share the UDF I use to validate integer values instead.

Read More
Gouache painting: in a garden shed two identical wooden rails each carry eight hooks

SET_BIT: Return a Changed Value Without Updating Data

July 29, 2007
Pinal Dave
SQL Tips and Tricks
SQL Datatype, SQL Function, SQL Scripts

SET_BIT returns a value with one bit set or cleared. Compare the default one with explicit zero, and keep scalar calculation separate from updates.

Read More
Gouache painting: at a market stall a wicker basket holds one whole peach, the largest, left behind

XQuery FLWOR: Filter and Rebuild a Small XML Result

July 25, 2007
Pinal Dave
SQL Tips and Tricks
SQL Function, SQL Scripts, SQL Server, SQL XML

XQuery FLWOR can iterate over source items and construct a different XML result. I use it to filter three products and reorder the survivors. The new elements deliberately differ from the source elements.

Read More
Previous 1 … 79 80 81 82 83 84 85 … 92 Next
  • Books
  • Testimonials
  • Privacy Policy

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