|
-
Jul 30th, 2008, 01:00 PM
#1
Thread Starter
PowerPoster
[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!
-
Jul 30th, 2008, 01:09 PM
#2
Thread Starter
PowerPoster
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.
-
Jul 30th, 2008, 01:41 PM
#3
Thread Starter
PowerPoster
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...
-
Jul 30th, 2008, 01:44 PM
#4
Re: URGENT: How do I update a database column if I can't see it all?
 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 
-
Jul 30th, 2008, 01:50 PM
#5
Thread Starter
PowerPoster
Re: URGENT: How do I update a database column if I can't see it all?
Naw, I got it.
Thanks though.
-
Jul 30th, 2008, 01:52 PM
#6
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
-
Jul 30th, 2008, 01:55 PM
#7
Thread Starter
PowerPoster
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!
-
Jul 30th, 2008, 02:40 PM
#8
Fanatic Member
Re: URGENT: How do I update a database column if I can't see it all?
 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?
-
Jul 31st, 2008, 02:53 PM
#9
Thread Starter
PowerPoster
Re: URGENT: How do I update a database column if I can't see it all?
 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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|