Andrew Poulter


Technical Article

User Defined Function for Padding Numbers

This scalar udf takes three parameters @Number INT, @Length INT, @Position CHAR(1) and returns a VARCHAR(50) string which pads @Number with zeros to the specified @Length either to the right or to the left, according to @Position ('L' or 'R').E.g. SELECT dbo.udf_PadNumber(5, 6, 'L') returns '000005' whereas SELECT dbo.udf_PadNumber(5, 6, 'R') returns '500000'. The function […]

You rated this post out of 5. Change rating

2006-03-13 (first published: )

153 reads

Technical Article

Last Day of Month

A script was recently published (Last_Date_Of_Month) that returns the last day of a given month/year combination. I have simplified and improved on that script by eliminating the need to use a WHILE loop. This new script exploits the flexibility of the DATEADD function which allows you to assign negative numbers (thus effectively subtracting a given […]

You rated this post out of 5. Change rating

2004-09-30

147 reads

Blogs

Building a Docker image with Docker Build Cloud

By

In a previous blog post we went through how to build a Docker container...

Top 8 Courses to Learn SQL for Data Science in 2024 & Beyond

By

Businesses are drowning in data, but starving for insights. That's where SQL experts swoop...

Going to Cloud? Look at the Shared Responsibility Model

By

The bottom line here is this: the idea that a CSP takes care of...

Read the latest Blogs

Forums

SQL server native CDC

By SQL_Surfer

Have anyone implemented CDC, and if so, what has been your experience with it?...

Import and Export wizard stuck on Guest user

By Sam-263310

I'm getting a error when using the Import and Export wizard to copy tables...

Aligning Compatibility Version Strategy

By BOR15K

I have joined a new project, where the business uses Azure SQL Hyperscale for...

Visit the forum

Question of the Day

Initial Config of tempdb

What are the initial config sizes for the tempdb primary data files, secondary data files, and log files in SQL Server 2022?

See possible answers