Scripts

Technical Article

Use of regular expressions in TSQL -- version 2

This script creates 2 new system functions ****************************************** NEW: 1. functions will be case sensitive if database is 2. Replace all or only first occurence ****************************************** fn__regexp_test(@String,@Pattern) returns int execute the method test(@String) on the regular expressions @Pattern returns : 0 : no match 1 : match null : one of the parameters was null […]

You rated this post out of 5. Change rating

2005-01-26 (first published: )

512 reads

Technical Article

Add Wildcards to Advanced Search Stored Procedure

I have found that I can add wildcard support to the Advanced Search Stored Procedure submitted by jgroseth (Posted: 07/02/2004) here:http://www.sqlservercentral.com/scripts/contributions/1201.aspby simply modifying "charindex( c.string," to "patindex('%' + c.string + '%'"I did this to take varying whitespace into account since SQL server does not care about whitespace, for example "INSERT INTO DATABASE_MYTABLE" could have any […]

You rated this post out of 5. Change rating

2005-01-25 (first published: )

512 reads

Technical Article

Generate Random Alphanumeric String

Here's a short script to generate a random alphanumeric string based on newid(). The procedure takes in length (@len) which determines the key length. Length must be between 8 and 32. Result is returned in an output parameter. A test script is supplied.

3.67 (3)

You rated this post out of 5. Change rating

2005-01-24 (first published: )

1,274 reads

Technical Article

t-sql function to parse string data

The below function can be used to parse or split out data from a delimited string. The function takes in 3 parameters. The text you want to parse, the 1 character delimiter, and the total count of objects in the text.Text for function is set at size of varchar(2000), feel free to make bigger if […]

You rated this post out of 5. Change rating

2005-01-19 (first published: )

1,871 reads

Technical Article

USER PROCESS CHECK (COMPLETE)

The following runable script is a very simple way to track SPID's and PROCESS information (VERY BASIC) in a small target (Local) database.1. Creates a small database 1.1 must set MDF and LDF (File location information) specific to the drive and file folder locations for each server2. Sets All db options3. Creates single table to […]

You rated this post out of 5. Change rating

2005-01-14 (first published: )

217 reads

Technical Article

Convert Unique Identifier to Varchar data type

Script will drop the Default, Primary, Unique, Foreign Constraints, Index and ROWGUID on Unique Identifier data type column and finally it alters the unique identifier to varchar (38) data type. I have compile and execute the script in my database server. Script has executed successfully.

You rated this post out of 5. Change rating

2005-01-12 (first published: )

764 reads

Blogs

Build a Snapshot Backup Catalog in Pure Storage - The SQL Server 2022 Edition

By

In my previous post, I showed you how to build a snapshot backup catalog...

Advice I Like: Training Employees

By

Train employees well enough that they could get another job but treat them well...

Creating a Striped Backup Set with AI

By

I needed to test a striped backup, so I decided to ask the AI’s...

Read the latest Blogs

Forums

Create an HTML Report on the Status of SQL Server Agent Jobs

By Nisarg Upadhyay

Comments posted to this topic are about the item Create an HTML Report on...

Why Data Modelling Still Matters - More Than Ever

By John Martin

Comments posted to this topic are about the item Why Data Modelling Still Matters...

hops from sql server to mysql to s4 hana - possible?

By stan

Hi when i think of server hops , i think of how kerberos assists...

Visit the forum

Question of the Day

Strange String Splits

When I run this code, how many rows are returned?

DECLARE @meals NVARCHAR(1000) = N'夕食昼食朝食'
DECLARE @s NVARCHAR(1) = N'食'
SELECT value
FROM STRING_SPLIT(@meals, @s)
GO

See possible answers