473,378 Members | 1,607 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Updating a text field in SQL Server

Hi,

I have a website using a SQL Server database to store all of it's data.
Retrieving data and writing basic data back is fine, however, when i go
to update one table that has a text field in it the update fails if
the amount of data being passed to the text field is too large.

Is there a way around this or a particular update i should be using?

Any information would be greatly appreciated.

Cheers
Bj

Jul 23 '05 #1
8 2681
Is the text data beyong 2GB? How large is the update?

If that being the case, this is a limitation you need to work with.

--
HTH,
Vinod Kumar
MCSE, DBA, MCAD, MCSD
http://www.extremeexperts.com

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp

<th*******@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hi,

I have a website using a SQL Server database to store all of it's data.
Retrieving data and writing basic data back is fine, however, when i go
to update one table that has a text field in it the update fails if
the amount of data being passed to the text field is too large.

Is there a way around this or a particular update i should be using?

Any information would be greatly appreciated.

Cheers
Bj

Jul 23 '05 #2
Hi Vinod,

The amount of data being passed to the update is on average about 2 or
3 paragraphs worth of data (in the one i was trying to insert there was
about 1000+ characters including whitespace).

Am i using the wrong driver or provider in my connection statement?
(connection string is: oConn.ConnectionString =
"Provider=SQLOLEDB.1;User ID=sa;PWD=password;Initial
Catalog=databasename;Data Source=machinename")

Cheers for any help you can give me further

Bj

Jul 23 '05 #3
On 2/14/05 6:34 AM, in article
11**********************@c13g2000cwb.googlegroups. com, "th*******@gmail.com"
<th*******@gmail.com> wrote:
Hi Vinod,

The amount of data being passed to the update is on average about 2 or
3 paragraphs worth of data (in the one i was trying to insert there was
about 1000+ characters including whitespace).

Am i using the wrong driver or provider in my connection statement?
(connection string is: oConn.ConnectionString =
"Provider=SQLOLEDB.1;User ID=sa;PWD=password;Initial
Catalog=databasename;Data Source=machinename")

Cheers for any help you can give me further

Bj


Typically, you add a javascript to your web page form field that limits the
number of characters entered to match the size of your field in the table.
It would help if you posted the error message. I would guess that it is a
warning that the data will be truncated.

-Greg

Jul 23 '05 #4
Hi Gregory,

I don't want to truncate it, i would like the whole data to be passed
through and inserted into the field. The field is of type TEXT (which
stores up to 2gig right?) so it should hold the amount of text i'm
wanting to insert. I think it's just a limitation of ADO and passing
that much data as a string possibly....

The error message is:

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
The identifier that starts with 'Long list of text that i'm trying to
insert' is too long. Maximum length is 128.

Cheers
Bj

Jul 23 '05 #5
(th*******@gmail.com) writes:
I have a website using a SQL Server database to store all of it's data.
Retrieving data and writing basic data back is fine, however, when i go
to update one table that has a text field in it the update fails if
the amount of data being passed to the text field is too large.

Is there a way around this or a particular update i should be using?

Any information would be greatly appreciated.


Is that text as in the datatype text, or just a varchar column?

In any case, you should specify "fails". That is, do you get an error
message or what? (And please post any error messages.)
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #6
(th*******@gmail.com) writes:
I don't want to truncate it, i would like the whole data to be passed
through and inserted into the field. The field is of type TEXT (which
stores up to 2gig right?) so it should hold the amount of text i'm
wanting to insert. I think it's just a limitation of ADO and passing
that much data as a string possibly....

The error message is:

Error Type:
Microsoft OLE DB Provider for SQL Server (0x80040E14)
The identifier that starts with 'Long list of text that i'm trying to
insert' is too long. Maximum length is 128.


This is because you are delimiting a string literal with double
quotes. SQL Server uses single quotes for string delimiters. Double
quotes are for delimiting identifiers with funny characters in the
them.

And by the way, you should be passing you strings as parameters to
a command. If you send the SQL string, you will need to handle
embedded quotes.

--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 23 '05 #7
Hi Erland,

<quote>
And by the way, you should be passing you strings as parameters to
a command
</quote>

How do i do this? Can you provide an example i can build on?

Cheers
Bj

Jul 23 '05 #8
On 2/14/05 7:31 PM, in article
11**********************@o13g2000cwo.googlegroups. com, "th*******@gmail.com"
<th*******@gmail.com> wrote:
Hi Erland,

<quote>
And by the way, you should be passing you strings as parameters to
a command
</quote>

How do i do this? Can you provide an example i can build on?

Cheers
Bj


Here is a link to a page with several examples of entering large amounts of
data from a web form into a SQL database. One of the examples shows the
command method.

http://authors.aspalliance.com/steve...les/sprocs.asp

-Greg

Jul 23 '05 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
16
by: Michael Walton | last post by:
I am trying to write some code that inserts or updates a text field in my SQL Server 2000 database. The SQL statement is created using a submit from a form, and the text is coming from a...
1
by: Harry Devine | last post by:
I have a DataGrid that is configured to use the Edit/Update/Cancel concept correctly. My grid shows values from 5 database fields. I only need to update that last 4 fields. The last field is a...
5
by: junglist | last post by:
Hi guys, I've been trying to implement an editable datagrid and i have been succesful up to the point where i can update my datagrid row by row. However what used to happen was that once i updated...
14
by: el_sid | last post by:
Our developers have experienced a problem with updating Web References in Visual Studio.NET 2003. Normally, when a web service class (.asmx) is created, updating the Web Reference will...
9
by: Kevin Blount | last post by:
Here's the code I tried, and found it failed... <form runat="server" method="post" name="CreditCardForm" id="CreditCardForm"> <% foreach (object item in Request.Form) { if...
0
by: TheDebbis | last post by:
I'm making a quick CD catalog to help me learn ASP.NET (using C# primarily.) I have a number of gridview's on my site that are working properly, but for some reason, one is not updating or deleting....
0
by: John Mason | last post by:
Hi, I've been trying for most of the day to get a FormView control to work. I would like to display a single record, based on a unique user id (loginid), which I am retreiving from a cookie. No...
0
by: Dan | last post by:
Hi, I have a detailsview with two fields: in editmode, one is a textbox and the other is a dropdownlist. i want to update both fields using the detailsview. My problem: when clicking on the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.