Qoute " in output ????

  • Hi,

    I am using the following :

    SELECT top 1 TAG_NAME = 'CUST_Height', TAG_DATA = UDF_VALUE_VARCHAR255

    FROM Client

    LEFT OUTER JOIN UDF_DATA_CLIENT UDC ON Client.OID=Udc.TABLE_OID

    WHERE client.OID=@CLIENT_OID and

    UDC.UDF_CONFIG_OID='259E9C43B0EF4F8CA78153AF478FA5D4'/* oid for height */

    I want my output to look like : 2'10"

    instead I get 2'10\quote\^

    this line is at the end of the SP

    UPDATE @TEMPTABLE SET TAG_DATA = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TAG_DATA,'"','\quote\'),'@','\at\'),'^','\carat\'),'|','\pipe\'),'=','\equal\') + '^'

    and im sure that ,'"','\quote\'), is causing it, is there a way to exclude TAG_NAME='Cust_Height'

    Thanks In advance

    Joe

  • Not a lot of detail to go on here but your replace statement did exactly what you told it to do.

    declare @Tag_Data varchar(200) = '2''10"'

    select @Tag_Data = REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(@TAG_DATA,'"','\quote\'),'@','\at\'),'^','\carat\'),'|','\pipe\'),'=','\equal\') + '^'

    select @Tag_Data

    If you want the output to be 2'10" remove that replace.

    select @Tag_Data = REPLACE(REPLACE(REPLACE(REPLACE(@TAG_DATA,'@','\at\'),'^','\carat\'),'|','\pipe\'),'=','\equal\') + '^'

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply