SQLInsider Scripts

Technical Article

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

  • Script

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)

You rated this post out of 5. Change rating

2007-09-13

1,183 reads

Technical Article

Verify Errorlog

  • Script

Hi this is my first post on sql....The below procedure will check the current errorlog(past one hour errorlog will be scanned)for the keyword "error" (you can include your own key word) .. If you run the procedure it will look for keyword error in the past one hour... it will be use full for some […]

You rated this post out of 5. Change rating

2007-09-12 (first published: )

721 reads

Technical Article

Function to Split a Delimited String into a Table

  • Script

This function splits a delimited string (up to 4000 characters long) into a single column table. The delimiter can be specified at the time of execution. If not specified, the delimiter defaults to a comma. The default length of each value is 100, but that can easily be changed.An example for usage:DECLARE @string NVARCHAR(4000)DECLARE @instruments […]

3.17 (6)

You rated this post out of 5. Change rating

2007-05-25 (first published: )

5,445 reads

Blogs

Deleting Old Local Git Branches–#SQLNewBlogger

By

I had a lot of local branches for a repo (actually a few repos)....

Use Your Voice

By

If you want more of a career and less of a job, one thing...

Real-World SQL Mastery: Your Hands-On, Mess-Free Sandbox

By

Are you ready to take your SQL skills from theoretical to tactical? If you've...

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers