Help with Registered and Trademark symbols

  • We have been asked to add several symbols to data currently existing in the database for a specific table, in a "name" field column. The data I'm adding has the "registered" and "trademark" symbols associated with the data being added.

    However, when I try to cut and past the UPDATE query (with the proper "registered" and "trademark" symbols next to the actual name) into the query analyzer it changes the values to the following:

    update grade set grade_name='TRANSCOPYâ' where grade_id='35800';

    update grade set grade_name='OPTICAä' where grade_id='35900';

    (The 1st update cmd with the â is the "registered" symbol, with a circle around the "R". The 2nd update cmd with the ä is the "trademark" symbol, with the letters TM.)

    - The SQL database version is SQL 2005 SP1.

    - The database column is VARCHAR(50)

    - The current database collation is: SQL_Latin1_General_CP1_CI_AS

    What is the proper way to handle data within a column, when one wants to have symbols such as the "trademark" within a database column?

    And how can I get this column of data updated with these symbols, so queries and reporting software display these symbols correctly?

    Any help would be appreciated...


    Dave Gradoville, MCDBA

  • It all depends on your output method and what character sets they support.

  • Antares686 (11/28/2007)


    It all depends on your output method and what character sets they support.

    As well the font can sometimes give you other than intended results.

  • ANT,

    Are you saying that the update cmd actually works properly, and the data is correctly updated with the appropriate symbol? If so, if a user has permissions to query the data in the column -- how does he/she tell what symbol is associated with the data?

    :unsure:


    Dave Gradoville, MCDBA

  • This should do it...

    UPDATE Grade

    SET Grade_Name = CASE

    WHEN Grade_ID = '35800'

    THEN 'TRANSCOPY' + CHAR(153) --™

    WHEN Grade_ID = '35900'

    THEN 'OPTICA' + CHAR(174) --®

    WHERE Grade_ID IN ('35800','35900')

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • That is the problem the character set you must have gotten it out of was symbol so if on a web page you display it it might look like this

    [font="arial"]TRANSCOPYâ[/font]

    when you want it to look like this

    [font="arial"]TRANSCOPY[/font][font="symbol"]â[/font]

    which looks right but I have to set the font for viewing myself. But if I made the whole line font = symbol it would look like this

    [font="symbol"]TRANSCOPYâ[/font]

    Some fonts have common support for registered like arial but the value is different

    [font="arial"]TRANSCOPY®[/font]

    and tahoma

    [font="tahoma"]TRANSCOPY®[/font]

    but would look like this in symobl

    [font="arial"]TRANSCOPY[/font][font="symbol"]®[/font]

    But I couldn't find a common one for Trademark.

  • By the way... your code seems to indicate that the Grade_ID is stored as a VARCHAR. If it's trully a numeric throughout, you may want consider changing the datatype to INT to keep people from entering anything but digits. Saves a bit of storage space, too.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden (11/28/2007)


    This should do it...

    UPDATE Grade

    SET Grade_Name = CASE

    WHEN Grade_ID = '35800'

    THEN 'TRANSCOPY' + CHAR(153) --™

    WHEN Grade_ID = '35900'

    THEN 'OPTICA' + CHAR(174) --®

    WHERE Grade_ID IN ('35800','35900')

    Thanks Jeff I couldn't find it off the top of my head. But like I stated these show in most common fonts as the expected but say you used the font Symbol they would not look right. The only absolute way to ensure you always get the expected look is to use an image file otherwise but Jeff's should cover 99% of the cases of anyone looking.

  • Thank you two (Jeff and ANT) very much - i really appreciate your time and effort!


    Dave Gradoville, MCDBA

  • gradpks ,

    You can view any of the character codes in charmap. To view charmap click --> start --> run --> charmap and get the proper key strokes or code to create each symbol. From here you can use the Char(###) function or you can actually perform the keystroke and put the char in single quotes.

    example Alt + 0169 = © then put it into single quotes for the update. E.g.

    UPDATE TABLE

    SET Col = 'String' + '©'

    WHERE some filter

  • Similar thing can be done in SQL Server...

    SELECT Number AS CharNum, CHAR(Number) AS Character

    FROM Master.dbo.spt_Values

    WHERE Type = 'P'

    AND Number < 256

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Sweet :hehe: I did not know about this, thanks Jeff !!

  • Heh... your welcome...

    spt_values table is the "original" Tally table... it goes from 0 to 255 in 2k and I think it goes to 1023 or 1024 in 2k5.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 13 posts - 1 through 12 (of 12 total)

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