Quotation

  • I have written a stored procedure that updates data, it runs ok until it reaches the name Milly's.

    I know the problem is with the quotation but I am not sure how to correct it.

    the fields are ORG= '''+@FIELD1+''',

    Field 1 equals Milly's

    Edited: Today @ 10:35:03 AM by clucasi

  • Cross Post

    http://www.sqlservercentral.com/Forums/FindPost928060.aspx

    Please keep to one thread.



    Clear Sky SQL
    My Blog[/url]

  • i have tried to use the below code but it errors

    ,ORGANISATION= '''+@FIELD18.replace("'","''")& ''' ,

  • This was removed by the editor as SPAM

  • In SQL2008 you can do this:

    ',ORGANISATION = ' + convert(varchar, cast(@FIELD18 as varbinary ),1)

    In SQL2005 you need to use system function:

    ',ORGANISATION = ' + master.dbo.fn_varbintohexstr(cast(@FIELD18 as varbinary ))

    See, you will not even need a quotes!

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

Viewing 5 posts - 1 through 4 (of 4 total)

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