Friday, February 14, 2020

TRIM() In SQL Server 2017


SELECT TRIM('     My test query     ')

/* Result */
My test query


SELECT TRIM( '.! ' FROM  '@     My Test Query   !..') AS Result;

/* Result */
@     My Test Query


SELECT len(TRIM( '.! ' FROM  '@     My Test Query   !..')) AS Result;

/* Result */
19


SELECT firstName, TRIM(char(32) FROM firstName) as Trim_name from Table

Firstname  TrimName
      Test      Test

No comments:

Post a Comment

Mixed Content: The page at xxx was loaded over HTTPS, but requested an insecure

 Mixed Content: The page at ' https ://www.test.com/signup.aspx' was loaded over HTTPS, but requested an insecure script ' http ...