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

448 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

328 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,597 reads

Blogs

India-US Tariff War: Is the Indian IT Sector at Risk?

By

How U.S.-India Tariff Disputes Could Ripple Through the Indian IT Sector Although the newly...

Save BIG on Microsoft Azure Certification – Up to 100% Off!

By

🌟 Why Microsoft Azure Certifications Are Beneficial for Your Career 🗓️ How to Schedule...

Modifying a Trigger to Capture More Info: #SQLNewBlogger

By

I had someone ask me about using triggers to detect changes in their tables....

Read the latest Blogs

Forums

What is a Failed Deployment?

By Steve Jones - SSC Editor

Comments posted to this topic are about the item What is a Failed Deployment?

Generating a Series I

By Steve Jones - SSC Editor

Comments posted to this topic are about the item Generating a Series I

Dimensional Modeling Case Study Part 3 - Dynamic Days Dimension

By Hang Liu

Comments posted to this topic are about the item Dimensional Modeling Case Study Part...

Visit the forum

Question of the Day

Generating a Series I

What is returned by this code in SQL Server 2022?

SELECT value
FROM GENERATE_SERIES(4, 1);

See possible answers