var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Append string to Text field....
I am trying to append some text to a full text field in SQL Server 2000. I tried this; but, it didn't work:
I get an error saying:
UPDATE DefendantEventPros SET EventComment=EventComment + ' This event was completed on "& Date() &".' WHERE EventNumber="& eventnumber &"
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid operator for data type. Operator equals add, type equals text.
How can I append some text to the end of a field? Thanks for any help!
SET EventComment= (SELECT EventComment + ' This event was completed ON "' + GETDATE() + '".' WHERE EventNumber=' + @eventnumber + ')
Thanks; but, i get the same error as my first one.
SET EventComment = EventComment +
' This event was completed on ' + Convert(varchar(20), GetDate()) + '.'
WHERE EventNumber = 1
I think including the date has caused some confusion. I was including the ASP date function to insert the date. I'll leave that out for now.
Here is my new code:
The EventComment field is a Text(16) field.
UPDATE DefendantEventPros SET EventComment=EventComment + ' This event has been completed.' WHERE EventNumber=1234
Last edited by bla4free; 12-10-07 at
I'm sorry. I meant Text(16)
Originally Posted by
would you mind scripting out your table into a CREATE TABLE statement?
I was referring to its length. I guess i wrote it wrong.
[EventComment] [text] COLLATE SQL_Latin1_General_CP1_CI_AS NULL
okay, try this --
SET EventComment = cast(EventComment as varchar(7000)) + ' This event was completed '
just don't run it 7000 times.
Originally Posted by
I ran a len query on my eventcomment field and i had several that were over 8000 characters. isn't varchar's limit 8000? i guess i'll just tell my code to ignore anything over that long to keep things simple. thanks for all your help!
in sql server 2000, the limit on varchar is 8000
but you said EventComment was TEXT
and you're planning to arbitrarily ignore the parts that are too long???
I guess I'll just ignore records with 8000+ characters and put some limits in our application. Maybe we can modify our process of how event comments are managed. Thanks again for your help!