Hello,

I seem to be running into a problem with regards to data size etc:

Explanation:
A person opens a .aspx page and posts and writes an article of a few
thousand words. When they click Insert Record they get this message:
System.Data.SqlClient.SqlException: String or binary data would be
truncated.
The statement has been terminated.
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at DreamweaverCtrls.DataSet.DoInit()

Problem:
It's to do with the size of the data being inserted into the record and I
have increased the VarChar length to 6000 characters to compensate. Is there
a better DataType to hold the information? With MS Access this is a major
problem but I would expect that but not with SQL Server? Any suggestions?

RE: SQL + Dreamweaver by NoSpamMgbworld

NoSpamMgbworld
Fri Aug 12 07:23:02 CDT 2005

SQL Server allows 8k per data page. If you have an int column (4 bytes), you
still have almost 8,000 ansi characters to work with. This is not enough for
the verbose, however, which forces you to use a Text field:

CREATE TABLE ArticlesForTheReallyVerbose
(
ArticleID int IDENTITY(1,1) PRIMARY KEY
, ArticleText text NOT NULL
)

You might think you can separate out the text into multiple fields, ala:

CREATE TABLE ArticlesForTheReallyVerbose
(
ArticleID int IDENTITY(1,1) PRIMARY KEY
, ArticleText1 varchar (7000) NOT NULL
, ArticleText2 varchar (7000) NOT NULL
)

... but you will go over the page size if someone actually is verbose.

There are pitfalls with text fields, but this case calls for one.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************


"Dam6" wrote:

> Hello,
>
> I seem to be running into a problem with regards to data size etc:
>
> Explanation:
> A person opens a .aspx page and posts and writes an article of a few
> thousand words. When they click Insert Record they get this message:
> System.Data.SqlClient.SqlException: String or binary data would be
> truncated.
> The statement has been terminated.
> at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
> cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
> at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
> at DreamweaverCtrls.DataSet.DoInit()
>
> Problem:
> It's to do with the size of the data being inserted into the record and I
> have increased the VarChar length to 6000 characters to compensate. Is there
> a better DataType to hold the information? With MS Access this is a major
> problem but I would expect that but not with SQL Server? Any suggestions?
>
>
>

Re: SQL + Dreamweaver by Dam6

Dam6
Fri Aug 19 05:47:10 CDT 2005

Thanks!!!

"Cowboy (Gregory A. Beamer) - MVP" <NoSpamMgbworld@comcast.netNoSpamM> wrote
in message news:EDBF41E0-20C9-4279-A229-205B8DB78876@microsoft.com...
> SQL Server allows 8k per data page. If you have an int column (4 bytes),
> you
> still have almost 8,000 ansi characters to work with. This is not enough
> for
> the verbose, however, which forces you to use a Text field:
>
> CREATE TABLE ArticlesForTheReallyVerbose
> (
> ArticleID int IDENTITY(1,1) PRIMARY KEY
> , ArticleText text NOT NULL
> )
>
> You might think you can separate out the text into multiple fields, ala:
>
> CREATE TABLE ArticlesForTheReallyVerbose
> (
> ArticleID int IDENTITY(1,1) PRIMARY KEY
> , ArticleText1 varchar (7000) NOT NULL
> , ArticleText2 varchar (7000) NOT NULL
> )
>
> ... but you will go over the page size if someone actually is verbose.
>
> There are pitfalls with text fields, but this case calls for one.
>
> --
> Gregory A. Beamer
> MVP; MCP: +I, SE, SD, DBA
>
> ***************************
> Think Outside the Box!
> ***************************
>
>
> "Dam6" wrote:
>
>> Hello,
>>
>> I seem to be running into a problem with regards to data size etc:
>>
>> Explanation:
>> A person opens a .aspx page and posts and writes an article of a few
>> thousand words. When they click Insert Record they get this message:
>> System.Data.SqlClient.SqlException: String or binary data would be
>> truncated.
>> The statement has been terminated.
>> at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
>> cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
>> at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
>> at DreamweaverCtrls.DataSet.DoInit()
>>
>> Problem:
>> It's to do with the size of the data being inserted into the record and I
>> have increased the VarChar length to 6000 characters to compensate. Is
>> there
>> a better DataType to hold the information? With MS Access this is a
>> major
>> problem but I would expect that but not with SQL Server? Any
>> suggestions?
>>
>>
>>