T-SQL

Technical Article

Multiple Replace

  • Script

Like the replace function, but can replace more than 1 value at a time.e.g. select dbo.multiple_replace('hello', 'e', '1', default) gives 'h1llo'.  Equivalent to: select replace('hello', 'e', '1')e.g. select dbo.multiple_replace('hello world', 'e;w;ld', '1;2;END', default) gives 'h1llo 2orEND'e.g. select dbo.multiple_replace('hello world', 'e$w$ld', '1$2$END', '$') gives 'h1llo 2orEND'

5 (1)

You rated this post out of 5. Change rating

2002-05-09

438 reads

Technical Article

UDF to convert Seconds to DDD:MM:MM:SS Format

  • Script

This function takes a number of Seconds in BIGINT format and calculations and displays that in a DDD:HH:MM:SS format.I wrote this because I needed to work out the duration between two datetimes and required the result to be displayed in a Report (VARCHAR (12)) format from a Select statementTo Use:SELECT dbo.csp_SecondsToDaysHoursMinutesSeconds(DATEDIFF(SS, , ))  AS DurationFROM […]

You rated this post out of 5. Change rating

2002-05-09

316 reads

Technical Article

Copying Data from one Database to Another

  • Script

This script will be helpful to only those people who arehaving identical database with different names.This script can be used to copy single or multiple tables from one database to anotherThe parameters @tname , source database and target database are important for the script to work. In the script below I have considered two databases […]

5 (1)

You rated this post out of 5. Change rating

2002-04-16

1,592 reads

Blogs

A New Word: Vicarous

By

vicarous – adj. curious to know what someone else would do if they were...

SQL Server Cross Platform Availability Groups and Kubernetes

By

Say we have a database that we want to migrate a copy of into...

Using Managed Identities with Azure SQL DB

By

We are trying to get apps and users off of using SQL accounts to...

Read the latest Blogs

Forums

We Stink!

By Grant Fritchey

Comments posted to this topic are about the item We Stink!

View works for me ...but doesn't return results for a user in SSMS but no errors

By krypto69

Hi I have this view to check if a job is running:   SELECT...

Dark mode, other color schemes

By mjdemaris

All, if you are like me and do not care for the built-in color...

Visit the forum

Question of the Day

Internal Checkpoints

Certain internal SQL Server actions cause internal checkpoints. Which of these actions does not cause an internal checkpoint?

See possible answers