Results 1 to 9 of 9

Thread: [RESOLVED] URGENT: How do I update a database column if I can't see it all?

  1. #1

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Resolved [RESOLVED] URGENT: How do I update a database column if I can't see it all?

    I have been given an hour to work on this problem which I thought would be easy, but I don't understand where my data is in order to update it. Here is what's happening.

    We generate letters to our customers using our web application and some of the body of the letter is in a database table. There is a column called txt which is 4096 bytes. This is what I need to update. But I don't know how to see this column. When I run a query in query analyzer it must stop at some limit because the string is truncated. When I view source of the asp page in which the letter is rendered, I see the complete contents. How do I update such a large column? And it's not straight text, it contains asp tags, like td and tr so I have to be very careful I get all the formatting correct.

    Thanks!

  2. #2

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: URGENT: How do I update a database column if I can't see it all?

    Well, what I'm doing in the interim (that is, the interim of getting expert help from this forum) is writing an update command in an asp.net program (because the code is handy and I am interfacing with the database in this code already). The Select I just executed in the program returned the full data, so I am assuming I can modify it and update it back to the db. Unless I hear a better idea in time... Thanks.

  3. #3

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: URGENT: How do I update a database column if I can't see it all?

    I'm almost there - I have that infamous problem where I want my SQL string to contain an apostrophe which is being intrepreted as end-of-string...

  4. #4
    Frenzied Member
    Join Date
    Jan 2006
    Posts
    1,875

    Re: URGENT: How do I update a database column if I can't see it all?

    Quote Originally Posted by MMock
    I'm almost there - I have that infamous problem where I want my SQL string to contain an apostrophe which is being intrepreted as end-of-string...
    would be better to use parameterized query
    __________________
    Rate the posts that helped you

  5. #5

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: URGENT: How do I update a database column if I can't see it all?

    Naw, I got it.

    Thanks though.

  6. #6
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: URGENT: How do I update a database column if I can't see it all?

    In QA - Tools -> Options -> Results Tab
    Set the Maximum Characters Per Column value.

    When I need to update large text columns in QA, I usually use

    Set Quoted_Identifier Off

    The above allows you to use double quotes to delimit strings, eg..

    Declare @Text varchar(8000)
    Set @Text = "You can now use single quotes ' in this string ' "
    Update Table Set Field = @Text

  7. #7

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: [RESOLVED] URGENT: How do I update a database column if I can't see it all?

    Great, thanks brucevde. I will play around with this later so next time I'll be able to use it right away. I didn't know about the quotes, that you could change them!

  8. #8
    Fanatic Member Clanguage's Avatar
    Join Date
    Jan 2008
    Location
    North Carolina
    Posts
    659

    Re: URGENT: How do I update a database column if I can't see it all?

    Quote Originally Posted by brucevde
    Declare @Text varchar(8000)
    Set @Text = "You can now use single quotes ' in this string ' "
    Update Table Set Field = @Text
    Cool tip.
    CLanguage;
    IF Post = HelpFull Then
    RateMe
    Else
    Say("Shut UP")
    End If
    DotNet rocks
    VB 6, VB.Net 2003, 2005, 2008, 2010, SQL 2005, WM 5.0,ahem ?OpenRoad?

  9. #9

    Thread Starter
    PowerPoster MMock's Avatar
    Join Date
    Apr 2007
    Location
    My Mustang GT
    Posts
    4,566

    Re: URGENT: How do I update a database column if I can't see it all?

    Quote Originally Posted by brucevde
    In QA - Tools -> Options -> Results Tab
    Set the Maximum Characters Per Column value.

    When I need to update large text columns in QA, I usually use

    Set Quoted_Identifier Off

    The above allows you to use double quotes to delimit strings, eg..

    Declare @Text varchar(8000)
    Set @Text = "You can now use single quotes ' in this string ' "
    Update Table Set Field = @Text
    Agreed. I tried this out and it worked perfectly. This is very useful to know, thanks again for taking the time to help!

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