Snowflake Vs MS-SQL - Part 29 - TRANSLATE

   


TRANSLATE

If there are unwanted characters in the database and you want to replace or remove those unwanted characters. 

If you see here, the actual string is "SQL Coding is Fun" but somehow there are unwanted and the string is saved as "SQLx Codiyng is zFun". 

We need to remove additional characters x,y & z.


MS-SQL Server 

You can achieve this by using REPLACE. But you need to take multiple iterations.



In Snowflakewe can use a similar syntax as above; however, Snowflake provides an alternative TRANSLATE.  By using this we can achieve a single iteration.



For more details, you can refer to the following TRANSLATE





     

Comments

Popular posts from this blog

Snowflake Vs MS-SQL - Part 36 - SPLIT_TO_TABLE

Snowflake Vs MS-SQL - Part 63 - ON Clause & Cross Join

Snowflake Vs MS-SQL - Part 33 - INITCAP