A reader, Virendra Chauhan, shared a UDF that removes duplicate chars from one large string. Here is his REMOVE_DUPLICATE_INSTR function and how to call it.
ReorientObject: Swap a Geographic Ring’s Interior
ReorientObject swaps a geography polygon’s interior and exterior. Compare inside and outside witnesses, then reorient twice to restore membership.
STPointOnSurface: Choose a Point Inside a Polygon
STPointOnSurface returns an interior point. Check a polygon with a hole, a simple polygon and an empty geometry without assuming exact coordinates.
Multiset Intersection: Keep the Matching Duplicate Occurrences
Multiset intersection keeps the duplicate count shared by both inputs rather than returning each common value once. I pair numbered occurrences to express that requirement. The result should contain the smaller count for each equivalent value.
Binary Conversion Styles: Hex With and Without 0x
Binary conversion styles control hexadecimal prefixes. Pair the output and input styles, preserve empty bytes and verify a complete round trip.
DEGREES: Preserve Fractions When Converting Angles
DEGREES converts radians into degrees. An integer radian argument can narrow the output, while a float argument retains an approximate fractional degree value.
Decimal Precision and Rounding in SQL Server
Decimal precision in SQL Server controls arithmetic results and rounding; use explicit scales, test boundaries, and compare money with decimal.







