15 February 2014

How to Get Trim String in SQL Server

In SQL no any TRIM function, it content LTRIM and RTRIM. so i created user function it called TRIM(<string>) for us for get trim string.
SET ANSI_NULLS ONGOSET QUOTED_IDENTIFIER ONGO
CREATE
 FUNCTION [dbo].[TRIM](@string VARCHAR(MAX))RETURNS VARCHAR(MAX)BEGIN
RETURN
 LTRIM(RTRIM(@string))END

No comments:

Post a Comment