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: )

158 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

151 reads

Blogs

Advice I Like: Focus on what’s important

By

Don’t let someone else’s urgency becomes your emergency. In fact, don’t be governed by...

India-US Tariff War: Is the Indian IT Sector at Risk?

By

How U.S.-India Tariff Disputes Could Ripple Through the Indian IT Sector Although the newly...

Save BIG on Microsoft Azure Certification – Up to 100% Off!

By

🌟 Why Microsoft Azure Certifications Are Beneficial for Your Career 🗓️ How to Schedule...

Read the latest Blogs

Forums

OpenQuery with Application Intent specified runs on primary node.

By kailash.kanaya

I have an Open query that runs on an Always On server via a...

What is a Failed Deployment?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is a Failed Deployment?

Generating a Series I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Generating a Series I

Visit the forum

Question of the Day

Generating a Series I

What is returned by this code in SQL Server 2022?

SELECT value
FROM GENERATE_SERIES(4, 1);

See possible answers