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

317 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: Incidental Contact High

By

incidental contact high – n. an innocuous touch by someone just doing their job...

Azure PostgreSQL Flexible Server and Entra Groups

By

My company is moving from an Azure PostgreSQL single server to a flexible server....

Take the 2025 State of Database Landscape Survey

By

The survey is out now and you can share your experiences for a chance...

Read the latest Blogs

Forums

GIT Configuration and Automated Release for Azure Data Factory

By Sucharita Das

Comments posted to this topic are about the item GIT Configuration and Automated Release...

How to Add a New Shared Disk to a WSFC as a SQL Resource

By muhkam

Comments posted to this topic are about the item How to Add a New...

Knowing What You Don't Know

By Louis Davidson (@drsql)

Comments posted to this topic are about the item Knowing What You Don't Know

Visit the forum

Question of the Day

Am I on Synapse?

How can I tell from T-SQL if I'm connected to SQL Server or Synapse Analyics?

See possible answers