SQL Server "TRIM" Command

7

I'm working with Sql Server , and I need to trim in a result of a query.

I did as follows:

select TRIM(NUMERO)
from ENDERECO

In% w / w the command is "recognized", it is in the coloration of a valid command, but returned the following error:

  

'TRIM' is not a recognized built-in function name.

I was able to resolve with the following command:

select RTRIM(LTRIM(NUMERO))
from ENDERECO

But I needed to use two functions that I think could be solved with only one function, and the command Sql Server Management , is there any way to "install" it, because trim     

asked by anonymous 03.01.2019 / 13:53

1 answer

6

The TRIM command is only recognized from the 2017 version, so its Sql Server Managemente recognizes it, but if you are connecting to an old version of Sql Server you will need to use RTRIM and LTRIM .

Font

    
03.01.2019 / 13:58