T-SQL

Technical Article

XTAB - CROSSTAB UTILITY

  • Script

sp_XTAB (prototype) produces pivoted (crosstab) views/output with a minimum of fuss.No messing with code, just tell XTAB what you want to pivot.Tested to 764 pivoted columns, XTAB can generate up to 63000 characters of dynamic sql. Example (deliberately over-simplified)----------------------updated 27 January 2004Use NorthwindEXEC sp_XTAB 'Northwind','xtEMPL_COUNTRY','Orders','EmployeeID','ShipCountry', '', 'OrderID','COUNT','NULL', '', 'SELECT xtEMPL_COUNTRY.* FROM xtEMPL_COUNTRY' -- Include optional […]

You rated this post out of 5. Change rating

2004-01-24

379 reads

Technical Article

UDF For Extracting Actual Time From Two DateTime

  • Script

Hi guys,       I have created a script of User-Defined-Function to extract the calulated time from two given datetime inputs. But you have to pass THREE parameters like :-a)Start Datetimeb)End Datetimec)To display the format either in HH:MM:SS or HH.MM , we    use 'T'(HH:MM:SS) OR 'N'(HH.MM).   Please feel FREE to E-mail me at […]

You rated this post out of 5. Change rating

2004-01-14

123 reads

Technical Article

Generate Random Alphanumeric Strings

  • Script

This script will generate and populate a table variable with a stipulated number of unique 8 randomly generated character alphanumeric values. This can be useful in situations where one has to allocate passwords or unique id to users. It accepts one input parameter "@HowMany int" representing the number of these alphanumeric values to generate; default=500.Usage: […]

You rated this post out of 5. Change rating

2004-07-06 (first published: )

2,454 reads

Technical Article

Generating random numbers in a range, sql2k

  • Script

This script will generated random numbers within a choosen Upper and LowerBound. I'v created a random number (int's) generator since i couldnt find a script which exactly did what I was searching for. The RAND function seems to do repetive patterns, so i created a new function based on the NEWID function.After running the two […]

You rated this post out of 5. Change rating

2004-10-08 (first published: )

368 reads

Technical Article

Find Overlapping Jobs

  • Script

Script lists all overlapping jobs that ran on selected server within last @Hoursback hours.Basically, idea behind this is to find jobs that are running at the same time, because that might significantly slow down server, especially if you have jobs that are running during business hours. You can do the same by looking into Jobs […]

5 (2)

You rated this post out of 5. Change rating

2004-01-02

935 reads

Technical Article

Generating sequential numbers - the fast way

  • Script

It is often necessary to generate a table with sequential numbers, up to a specified upper limit N. For small N, a simple INSERT in a WHILE loop will do. But, for large N, that solution becomes too slow. This script presents a different approach. It generates sequential numbers from the binary representation of N, […]

4.5 (2)

You rated this post out of 5. Change rating

2004-12-30 (first published: )

597 reads

Technical Article

Convert Numeric Figures into Words

  • Script

Hi guys    What about a function that converts a number figure into words.This sample script is to demonstrate the procedural capabilities of SQL Server . Samples  select fig2words(10) will give --Ten-- ,select fig2words(103) will give --one hundred and three --    The author uses much under utilized capability of SQL Server the recursive function calls to […]

You rated this post out of 5. Change rating

2003-11-11

534 reads

Blogs

A New Word: Mottleheaded

By

mottleheaded – adj. feeling uneasy when socializing with odd combinations of friend and family,...

Democratizing Core Contributions: A Guide to WordPress.org Badges 

By

In the WordPress community, badges aren’t just for scouts.

Microsoft Purview GA menu’s

By

The new data governance features in Microsoft Purview are now being made generally available...

Read the latest Blogs

Forums

test new topic

By philip.scott

posting a new topic

New article

By Steve Jones - SSC Editor

Comments posted to this topic are about the item New article

Monitoring Azure Blob Storage

By arindamxs

Comments posted to this topic are about the item Monitoring Azure Blob Storage

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers