LSTR() and RSTR(): Enhanced LEFT() and RIGHT()

Quite often I need to cut off the first (or last) few characters of a string. To do just that I created two functions LSTR() and RSTR().Syntax: LSTR( @stringtocut, @length )Note: @stringtocut is trimmed in the functionWhen @length is equal or larger than zero, this function performs the same as LEFT( LTRIM(RTRIM(@stringtocut)), @length ).When @length […]

1.67 (3)

2007-09-13

792 reads

Blogs

Azure SQL Database – Azure Portal Updates

By

A small but useful change has been made to the Azure Portal for Data...

SQL Server Quick Tips

By

Earlier this year I made a series of videos that were played before the...

The 2019 State of DevOps Report–Webinar

By

Tomorrow I get to chat with another giant in the world of DevOps: Jez...

Read the latest Blogs

Forums

Is Data the Future of the Vibrant Web?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Is Data the Future of...

Tsql/SP Code Optimization

By sizal0234

Hi, I am working on optimizing some of Tsql code for SP's. I know...

Powershell

By sizal0234

Does PS help in performance. Like instead of TSQL code used in sql agent...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers