Technical Article

Pad Number

A simple UDF for padding out numbers with a specific character (eg: pad 3 to show as 003).Usefull when you can only sort as a text item or for formatting purposes.Script is similar to the SPACE() function but allow the padding character to be defined.Usage:dbo.padNumber('string to pad', padsize, padchar)eg:SELECT dbo.padNumber('53', 4, '0') as testNumReturns:testNum-------0053

You rated this post out of 5. Change rating

2003-07-25

199 reads

Blogs

Speaking at SQL Saturday South Florida 2024

By

I’m heading to SQL Saturday South Florida 2024 next week. This is my second...

The Next Phase & A Fresh Start

By

As of June 1, I am no longer an employee at 3Cloud. I am...

How do you restore a SQL Server 2000 database in the year 2024?

By

A discussion on LinkedIn led to this hypothetical “real world” question: Problem statement: I...

Read the latest Blogs

Forums

MSOLEDBSQL/MSOLEDBSQL19 - Linked Servers and encryption

By Fozzie

Yes I know Linked Servers can be evil... but they can be fine and...

dbcc clonedatabase issue

By blom0344

I have used the 'dbcc clonedatabase'   schema-only backup procedure many times in the past...

Visit the forum

Question of the Day

The Secondary Database Name in an AG

I am setting up a SQL Server 2022 Availability Group and I am ready to restore the database on the secondary. The primary database is named Finance. However, we also use this instance for QA and already have a database named Finance. How do I configure the AG to use a different database as the secondary?

See possible answers