473,597 Members | 2,342 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding text to a text column

27 New Member
Hi

I want to have a log so in my table i got a TEXT field called LOGG. I want to update this field with new data by adding more text to field.

I am using MS SQL

'test' + 'test' doesn't work . say you cant add 2 text to each other

concat('test',' test') doesn't work . say that CONCAT isn't a built in function


this code works but is it really the best way to do? and how long can a varchar be?

Expand|Select|Wrap|Line Numbers
  1. UPDATE    GAMES
  2. SET LOGG =
  3. CAST(CAST(LOGG AS varchar(200)) + CAST('test' AS varchar(5)) AS text)
  4.  
  5. WHERE     (ID = 21)
Oct 9 '06 #1
3 21511
galexyus
15 New Member
Hey,

Use this instead:
Expand|Select|Wrap|Line Numbers
  1. DECLARE @ptrval varbinary(16)
  2.  
  3.  
  4. SELECT @ptrval = TEXTPTR(LOGG)
  5. FROM GAMES
  6. WHERE ID = 21
  7.  
  8. UPDATETEXT GAMES.LOGG @ptrval NULL NULL 'your text'
  9.  
And varchar can be 8000 long.
Oct 9 '06 #2
Metalzed
27 New Member
Thanks for the help. worked perfekt.




Hey,

Use this instead:
Expand|Select|Wrap|Line Numbers
  1. DECLARE @ptrval varbinary(16)
  2.  
  3.  
  4. SELECT @ptrval = TEXTPTR(LOGG)
  5. FROM GAMES
  6. WHERE ID = 21
  7.  
  8. UPDATETEXT GAMES.LOGG @ptrval NULL NULL 'your text'
  9.  
And varchar can be 8000 long.
Oct 9 '06 #3
bayatloo
1 New Member
you can use this samlpe

UPDATE Yourtable SET Bemerkung = convert(varchar (2000),Bemerkun g) + 'Yourtext hire ' WHERE ID= 111111
Nov 6 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

5
5274
by: Sue | last post by:
On code-behind page: (attributes set programatically for each of these elements) linkbutton added to tablecell textbox added to tablecell tablecells added to tablerow tablerow added to table (table.ID is TestTable) On .aspx page: <HeaderTemplate> <asp:Table ID="TestTable" runat="Server" /> </HeaderTemplate>
3
16990
by: Claudio Lapidus | last post by:
Hello Now perhaps this is a bit dumb, but... I just populated a new table via \copy. After that, I realize that perhaps is a good thing to have a row identifier in it, so I try clapidus=> alter table tickets add column rid serial; NOTICE: ALTER TABLE will create implicit sequence "tickets_rid_seq" for SERIAL column "tickets.rid" ERROR: adding columns with defaults is not implemented
3
2116
by: MS | last post by:
What's the best way to "store" and display a value in a text box that changes from day to day. An example of this would be where the name of the user is manually typed in after using the datbase, along with (say) the date. ATM, I have a table with (say) 4 fields. Each field is linked to a column in a combo box. The combo box is invisible on the form. The text boxes display previous data using code something like this... Private Sub...
2
3624
by: Clayton Hamilton | last post by:
I have a DataGrid on a webform bound to a Datasource and can successfully use <ItemTemplate> to create edit/update/cancel functionality for user maintenance of data. I use separate logic to delete a row. Everything works just fine. BUT I would like to add a button to (for example) the DataGrid header, which when pressed will add a new row to the datagrid. This should then allow the user to enter information into text boxes (in some...
0
1919
by: Chris Millar | last post by:
I have a user control that i wish to extend to change the date when the user selects the numeric up down button. The code explains itself, hope someone can help. any ideas appreaciated.. Chris. code :
0
12274
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str; item.SubItems.Add(str); In the example code that follows, using the first line (in the ListView constructor) causes the later redisplay of values (to some specified number of decimal places) in the ListView not to work. Using the second line causes
3
4867
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that the best method? Do you have a sample of how to do this?
6
4404
by: Rudy | last post by:
Hi all, I know this is easy, just can't seem to get it. I have a windows form, and a text box, with a value already in it. I need to add that value to a table. It's just one value, so the entire row doesn't get filled. I have a connection and all that stuff. Private Sub btnPlaceBet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPlaceBet.Click ' Dim Myds As Footbet.DStable '...
1
4794
by: Ben Ramsey | last post by:
I'm using PostgreSQL on a Windows 2000 server and cygwin. All is set up just fine. The database works just fine, and ASP is connecting to the database through a DSN just fine. The only problem I seem to have is adding a large amount of text to a text column in the database. I can enter up to 8,118 characters (including spaces), but when I go over that amount, I receive the following error: Microsoft OLE DB Provider for ODBC Drivers...
7
6189
by: =?Utf-8?B?V2ViQnVpbGRlcjQ1MQ==?= | last post by:
I'm adding subheadings to a gridview. Each sub head has a few link buttons. I'm adding the controls in the rowdatabound event code follows: sorry about the length here. I have to be missing something. The buttons show up and post back, but the events do not fire. any help would be appreciated!!! Thank you. protected void gvEntitiesRowDataBound(object sender, GridViewRowEventArgs e) {
0
8272
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8035
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6688
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3886
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3927
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2404
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1238
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.