User Defined Function (UDF)

External Article

SQL Server user defined function to convert MSDB integer value to time value

  • Article

In a recent tip I outlined a process for converting a date, stored as an integer into a datetime data type. Date and time information for run history of SQL Server Agent jobs is stored within the msdb..sysjobshistory table as an integer data type, not as a datetime as one would expect. As promised, this tip picks up where we left off. On converting the integer-typed run_time into a format that is more user friendly for presentation purposes.


2,522 reads

External Article

SQL Server UDF to pad a string

  • Article

Unlike other relational database management systems that shall remain nameless, SQL Server's underlying coding language, T/SQL, does not have a built-in function for padding string values. I recently took it upon myself to create my own and as you'll see I got a little carried away


2,910 reads

External Article

Using schema binding to improve SQL Server UDF performance

  • Article

SCHEMA BINDING is commonly used with SQL Server objects like views and User Defined Functions (UDF). The main benefit of SCHEMA BINDING is to avoid any accidental drop or change of an object that is referenced by other objects. A User Defined Function (UDF) may or may not access any underlying database objects, but in this tip we show how using SCHEMA BINDING with a UDF can improve performance even if there are no underlying objects.


4,200 reads


What Do I Do to Relax?


I’ve republished an editorial today from another author, called What do you do to...

Daily Coping 9 Dec 2022


Today’s coping tip is to find out something new about someone you care about....

Advent of Code 2022


Foreword Advent of Code is an annual event in which participants solve a series of...

Read the latest Blogs


SSRS - Add end date for all SSRS subscriptions

By pwalter83

Hi, Could you please advice if it is possible to add an end date...


By saintor1

I have been using this for a long time.   It was done initially in...

blank page

By carjara

Hi guys! The topic "Connect to SQL Server with Python to Create Tables, Insert...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

The Temp Alias

See possible answers