Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Much traffic on insert with varchar fields

Author  Topic 

Christian
Starting Member

2 Posts

Posted - 2005-11-29 : 06:47:30
I have a table with only a varchar (900) field, it is my unique key.

When I insert 60 rows via ODBC (using dynamic SQL), a lot of traffic occur (60 kB). I insert only unique numbers with a length of 4 digits.

When I select data without rtrim: 60 kB
When I select data with rtrim: approx. 2 kB.

ANSI_PADDING is on default value (ON), it is not possible to change the tables.

It looks like dynamic variables are created with maximum length and transferred with this length. :-(

Can I change this behavior to reduce the traffic on slow networks? Is there any option for the session or the statement?

TIA
Christian

X002548
Not Just a Number

15586 Posts

Posted - 2005-11-29 : 10:14:55
CREATE TABLE myTable99 (Col1 varchar(900) PRIMARY KEY)

Really?

Try using a stored procedure to insert the rows...if you are only inserting 4 difits though, why is the column 900 bytes?



Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

Christian
Starting Member

2 Posts

Posted - 2005-12-01 : 02:00:36
I try to find an easy example, in the application some notes will be stored in that field ...
Varchar is handled like char (filled up with blanks), look like a problem with a library here.
Christian
Go to Top of Page
   

- Advertisement -