Update <long text> column in SQL Srvr databse

Posted on 2009-02-11
Last Modified: 2013-12-03
I need to update a long text column in a SQL server database. The text that has to be updated is a script and has a lot of single quotes( ') in them. Any help is appreciated...
Question by:Ravishanka
    LVL 25

    Expert Comment

    Is the script already stored in a variable or column or do you have to update it as a literal value?

    Author Comment

    It is not in a variable, we have to update it as a literal value.
    LVL 25

    Accepted Solution

    In that case just do a find and replace to replace all instances of single quote (') with two single quotes ('') and then enclose the whole value within one pair of single quotes..

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Nowadays, some of developer are too much worried about data. Who is using data, who is updating it etc. etc. Because, data is more costlier in term of money and information. So security of data is focusing concern in days. Lets' understand the Au…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now