Results 1 to 1 of 1

Thread: Inserting Large string into SQL Server Database? [Resolved]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member <ABX's Avatar
    Join Date
    Jul 2002
    Location
    Canada eh...
    Posts
    1,622

    Resolved Inserting Large string into SQL Server Database? [Resolved]

    I'm writing a Web Service in vb.net to encapsulate all the database logic and have got almost everthing working except that i get an error when i try to insert a large html formmated string using SQL.

    Code:
    INSERT INTO Data_Lyrics (SongID, DateCreated, RevisionNumber, Lyrics) VALUES ('782', '10/17/2004', '1', 'I am .....')
    I shortend Lyrics as it is about 1000 chars long, it contants html formatted text (basicly only "<br />")

    Exception:
    Code:
    System.Data.SqlClient.SqlException: Line 1: Incorrect syntax near 'm'.
    Cannot use a BREAK statement outside the scope of a WHILE statement.
    Cannot use a BREAK statement outside the scope of a WHILE statement.
    Cannot use a BREAK statement outside the scope of a WHILE statement.
    Cannot use a BREAK statement outside the scope of a WHILE statement.
    Cannot use a BREAK statement outside the scope of a WHILE statement.
    is <br /> conflicting w/ a sql reverved word? if so, how can i ecsape it?

    EDIT:

    My problem was that the string i was inserting contained a " ' ".

    I escaped the ' and everything is working fine, prolly going to move over to stored producures tho.
    Last edited by <ABX; Oct 17th, 2004 at 05:16 PM.
    Tips:
    • Google is your friend! Search before posting!
    • Name your thread appropriately... "I Need Help" doesn't cut it!
    • Always post your code!!!! We can't read your mind!!! (well, at least most of us!)
    • Allways Include the Name and Line of the Exception (if one is occuring!)
    • If it is relevant state the version of Visual Studio/.Net Framwork you are using (2002/2003/2005)


    If you think I was helpful, rate my post
    IRC Contact: Rizon/xous ChakraNET/xous Freenode/xous

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width