Cool Tips‎ > ‎

Data Conversion

 

Title

Description

Applicability

 

Convert Decimal to base n

 

Converts any base 10 integer to a string representation in a base from 2 to 36.

 

2000, 2005, 2008, 2008R2, 2012

 

 

Calculate distance between 2 lat/long coordinates    

 

Straight line distance in Km.

 

2000, 2005, 2008, 2008R2, 2012

 

Convert HEX to BIGINT    

 

Multiple approaches for 2000/2005 and 2008/2012.

 

2000, 2005, 2008, 2008R2, 2012

 

Check the impact of converting from NVARCHAR to VARCHAR

Creates Dynamic SQL code that will check for potential data corruption/loss when converting from UNICODE.

 

2000, 2005, 2008, 2008R2, 2012

 

Convert GPS Decimal to DMS        

Converts a decimal representation of a lat/long coordinate to Degrees/Minutes/Seconds format string.

 

2000, 2005, 2008, 2008R2, 2012

 

Convert to and from Roman Numerals    

 

Indispensable!

 

2000, 2005, 2008, 2008R2, 2012

 

String Splitter - Very Fast        

 

Pivots a delimited list into a single column results table.

 

2000, 2005, 2008, 2008R2, 2012

 

Generate 'Numbers' Table

Three methods (with and without CTE and using OVER clause) of generating a dynamic table of sequential numbers.

 

2000, 2005, 2008, 2008R2, 2012

 

String Unsplitter    

 

Pivots a single column into a comma delimited list.

  

2000, 2005, 2008, 2008R2, 2012

 

Spell out Numbers    

 

Function to Convert Integer or Decimal format numbers to their text equivalent.

 

2000, 2005, 2008, 2008R2, 2012

 

Generate Random Strings    

 

Generates a list of random VARCHAR(8) strings. 

 

2000, 2005, 2008, 2008R2, 2012

 

Convert String to Proper Case    

 

Converts a mixed case text string to Proper Case.

 

2000, 2005, 2008, 2008R2, 2012

 

Remove Selected Characters from a String    

 

Removes characters specified by a REGEX from a supplied string.

 

2000, 2005, 2008, 2008R2, 2012

 

 

 

 

 

 

Comments