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

960 reads

Blogs

Goal Progress–November 2020

By

This is my report, which continues on from the Oct report. It’s getting near...

Azure Synapse Analytics is GA!

By

(Note: I will give a demo on Azure Synapse Analytics this Saturday Dec 5th...

5 Things You Should Know About Azure SQL

By

Azure SQL offers up a world of benefits that can be captured by consumers...

Read the latest Blogs

Forums

Get data from last line and merge into data stream before removing

By Bruin

This script reads thru a file and removes the last line, but before it...

Firewall access for Availability Group listeners

By webrunner

Hello experts, I have a noob question as I never feel like I understand...

conversion of excel formula to case statement in tsql

By Abhas

Hi  all, need your help on conversion of excel formula into case statement. i...

Visit the forum

Ask SSC

SQL Server Q&A from the SQLServerCentral community

Get answers