Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Trim Function

Posted on August 8, 2013October 26, 2015 By David Kittell

–FOR SQL SERVER 2000:

CREATE FUNCTION dbo.TRIM(@string VARCHAR(8000))
RETURNS VARCHAR(8000)
BEGIN
RETURN LTRIM(RTRIM(@string))
END
GO

–FOR SQL SERVER 2005:

CREATE FUNCTION dbo.TRIM(@string VARCHAR(MAX))
RETURNS VARCHAR(MAX)
BEGIN
RETURN LTRIM(RTRIM(@string))
END
GO

Source: http://blog.sqlauthority.com/2007/04/24/sql-server-trim-function-udf-trim/

Originally Posted on August 8, 2013
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code MSSQL

Post navigation

Previous post
Next post

Related Posts

Check Instance Of Application

Posted on May 9, 2014October 26, 2015

Preferred Method: Project Menu -> Properties -> Application -> Check Box: Make Single Instance Application Non-Preferred Method: This code will look in your task manager for the same name of your application, if it exists it will prevent another copy of it from running. ‘ Make sure they only have…

Read More

PowerShell – Create System Path

Posted on March 4, 2016March 4, 2016

Possibly the easiest manual way is in Windows 10 and Windows 2012 R2 (likely previous versions too but don’t have them handy while writing this): From the Desktop, right click on the Windows icon (Start Menu) in the bottom left of the screen Click on “System” Click the “Advanced system…

Read More

NMAP – Find Machines On Your Network

Posted on March 23, 2017May 22, 2019

NMAP (a form of ARP list) is a tool for scanning your network for machines that are up or down along with pulling some helpful information from the machines that are up. Similar to Remotely Find Raspberry Pi IP but this is a bit more in-depth First install nmap if…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes