set nocount on
set quoted_identifier off
SELECT
-- Core columns cleaned
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), INTERNIDENTITY), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), INTERNINSTID), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), INTERNVERSION), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), INTERNTIMESTAMP), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), INTERNRECTYPE), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(ORDERID, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), SYNCNUM), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(IDSOURCE, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(MEMOID, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(MEMOTYPE, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), BIDPX), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), BIDSIZE), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), LASTSALE), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(MARKETCENTERID, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(MEMOCOMMENTS, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), OFFERPX), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), OFFERSIZE), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(ORDERIDS, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), ORDSYNCNUM), char(160), ' '), char(194), ''))),'') + '¬' +
-- OVERRIDERULESET: handle CR/LF + non-breaking spaces
isnull(
cast(
str_replace(
str_replace(
str_replace(
str_replace(ltrim(rtrim(convert(varchar(16384), OVERRIDERULESET))),
char(13), ' '),
char(10), ' '),
char(160), ' '),
char(194), '')
as varchar(16384))
,'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(QUOTECONDITIONINDICATOR, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), QUOTETIME), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(RULE92COMMENT, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(SALESTRADERCOMMENTS, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(TICKDIRECTION, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), TOTALDOLVOL), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), TOTALVOLUMETRADED), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(TRADERCOMMENTS, char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), LULDLOWERPXBAND), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), LULDUPPERPXBAND), char(160), ' '), char(194), ''))),'') + '¬' +
isnull(ltrim(rtrim(str_replace(str_replace(convert(varchar(50), LULDPXBANDTIMESTAMP), char(160), ' '), char(194), ''))),'')
FROM ZMemo
go
Top comments (0)