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

148 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

146 reads

Blogs

Using a tnsnames.ora file with the Microsoft Connector for Oracle in SSIS

By

One of the nice things about the Microsoft Connector for Oracle is that it...

ChatGpt Experiments–Getting Documentation

By

I get asked questions by salespeople all the time. Usually this is because a...

A New Word: Jouska

By

jouska – a hypothetical conversation that you compulsively play out in your head –...

Read the latest Blogs

Forums

Azure SQL Revealed: A Guide to the Cloud for SQL Server

By Site Owners

Comments posted to this topic are about the item Azure SQL Revealed: A Guide...

Refresh Limits

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Refresh Limits

How Many Days Can You Survive?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item How Many Days Can You...

Visit the forum

Ask SSC Logo Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers

Question of the Day

Refresh Limits

See possible answers