Scripts

Technical Article

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

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

320 reads

Technical Article

Update existing user accounts default language.

When changing the default language of a server it is neccessary to run sp_defaultlangauge against any existing logins. The reason is default language only effects any new accounts created after this change is made. This script is designed to help you quickly make the adjustment for all existing accounts. Note: this has been tested under […]

You rated this post out of 5. Change rating

2002-05-09

122 reads

Technical Article

User defined function to parse delimited strings

This UDF parses a comma delimited string and returns a table with the parse strings as rows. Usage:  select * from fn+PareseString('12,13,14,67')Will return a table with the following rows12131467Can be modified to have an additional parameter for the type of delimiter.

You rated this post out of 5. Change rating

2002-05-07

891 reads

Technical Article

Cursorless Cursor

Here is as sample of implementing cursor.In some cases my tests showed that this approach performs better than native cursors in SQL Server.All you have to do is move the dataset into a temp table with a new Identity column and then use a simple loop to extract the data as you would do normally […]

4.5 (2)

You rated this post out of 5. Change rating

2002-05-06

1,962 reads

Blogs

Master the Foundational Basics

By

It tells us to take the time to master the foundational basics of whatever...

Simple Talks Episode 9–Data masking and subsetting

By

The episode on data masking and subetting is out. You can see it here:...

T-SQL Tuesday #180: Avoid Perfect for Good Enough

By

I'm listening to Effortless by Greg McKeon (link to author's page) through Audible.com. He...

Read the latest Blogs

Forums

How to write this query?

By water490

Hi everyone I have two tables storing stock prices.  Each table comes from a...

ssrs order of operation question

By stan

hi i need "sample size" in my report's 4th data region which is a...

Query Network Protocols from T-SQL or PowerShell

By webrunner

Hello experts, I want to be more organized about the SSL certificates we have...

Visit the forum

Question of the Day

The Hash Join I

What are the two inputs called to a hash join operation in SQL Server? (choose 2)

See possible answers