Forum Discussion
SQL REPLACE function broken on Fabric Lakehouse SQL Endpoint
- 1 year ago
Hi jpersQ
To remove all carriage return (CHAR(13)) and line feed (CHAR(10)) characters from your SQL Server data, you can utilize the REPLACE function as follows:SELECT [Id],
[Description],
REPLACE(
REPLACE(
REPLACE(Description, CHAR(13) + CHAR(10), ''),
CHAR(13), ''),
CHAR(10), '') AS Cleaned_Description
FROM bronze_Salesforce_event;Best regards,
Ray Minds
http://www.rayminds.com
https://www.linkedin.com/company/rayminds/If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- jpersQ1 year agoFrequent Visitor
The query is as above:
SELECT ASCII(SUBSTRING(REPLACE(REPLACE(CAST([Description] AS NVARCHAR(4000)), NCHAR(13), ''), NCHAR(10), ''), 14, 1)) AS D FROM [dbo].[bronze_Salesforce__event] where Id= '00UVS000003zCXI2A2'I'm having a hard time getting an anyonymized data example since the issue is finicky.
- nilendraFabric1 year agoSuper User
SELECT ASCII(SUBSTRING(REPLACE(REPLACE(CAST([Description] AS VARCHAR(8000)), CHAR(13), ''), CHAR(10), ''), 14, 1)) AS D
FROM [dbo].[bronze_Salesforce__event]
WHERE Id = '00UVS000003zCXI2A2'try this once
- jpersQ1 year agoFrequent Visitor
Already tried, it doesn't fix the issue. Neither does casting as NVARCHAR, or casting as NVARCHAR plus using NCHAR(13) and NCHAR(10).