Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Update field using stored procedure

Status
Not open for further replies.

macrane

Programmer
Jan 14, 2002
10
US
I am writing to my database from an Active Server Page on our website using a stored procedure. All values are being written to the database successully. However, I have a comments field that is a varchar 2500 that I need to maintain the existing value and then add any new value that is provided. I've done this previously using
UPDATE tablename SET fieldname1 = (fieldname1 + @variable) where fieldname2 = @AnotherVariable

This time it is not working. I have checked permissions and everything is where it should be. All other information is being written but this.

Any help is greatly appreciated.

Thanks

Marianne
 
This is what I would try first, and you probably already tried it.
UPDATE tablename
SET fieldname1 = (rtrim(fieldname1) + @variable)
where fieldname2 = @AnotherVariable

next try:

UPDATE tablename
SET fieldname1 = rtrim(fieldname1) + convert(varchar(2500),@variable)
where fieldname2 = @AnotherVariable

 
Just a thought, is the update you are doing perhaps taking you past the 2500 character limit?

Questions about posting. See faq183-874
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top