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

127 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

144 reads

Blogs

SSAS Tabular – Process Add memory consumption

By

For me it’s a bit surprising how little information can be found regarding the...

Our SQL Server 2019 Administration Inside Out Fun Author Survey

By

SQL Server 2019 Administration Inside Out Honored again to be leading the talented SQL Server...

What's New in SQL 2019? at the Data Architecture Virtual User Group and Q&A followup

By

Thanks to all 180+ of you who joined the Data Architecture Virtual User Group...

Read the latest Blogs

Forums

What is spinlock ALLOC_CACHES_HASH?

By My_Sky

Hi, Queries are slow, cpu usage at 80%. ALLOC_CACHES_HASH backoffs start at same time...

BULK insert several thousand files

By MVDBA (Mike Vessey)

I have a bunch of logging data that my sysadmin has downloaded from our...

SSRS 2016 install on FCI with AAAG.

By snomadj

Appreciate advice here as I am slightly confused. I need to install SSRS 2016...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers