Andrew Poulter


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 […]

2006-03-13 (first published: )

131 reads

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 […]

2004-09-30

146 reads

Blogs

Ethics in Modern Data this Saturday with the South Florida Data Geeks

By

This Saturday Aug 7, Christine and I will present our joint presentation on Ethics...

3 Reasons Why Focusing on Tech Is The Worst Way To Deploy a HA/DR Solution

By

This past Thursday, Edwin Sarmiento presented a session for our Microsoft Data Platform Continuity...

The PowerBI Volleyball Report – Organizing Data To Start

By

One of my goals this year was to build a report that I can...

Read the latest Blogs

Forums

ColumnStore Index Maintenance routines

By doodlingdba

Hi all I use the Ola Hallengren Index Optimize script for rowstore index maintenance...

Minimun Role Permissions Needed

By Lou

Hi Friends, Please some guidance, To import a bacpac file in a MI instance,...

Need counts of payment amounts per week grouped by week

By joewhite

Hello, I have a code that suppose to give me weekly(summed) payments, but instead,...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers