Groups | Blog | Home
all groups > sql server programming > february 2006 >

sql server programming : writing ntext: strange issue for MVPs


Avi
2/13/2006 8:04:20 PM
Hi

I am having trouble writing/saving large text strings to a sql server 2000
table with 3 ntext columns. The command object (from adodb or ado.net) times
out. I have looked through all the postings and help and it would seem that
this should always be a problem and that using WRITETEXT or UPDATETEXT is one
way to address the issue.

The STRANGE part is that this does not consistently happen:
a) inconsistency #1: the problem does not occur on 2 dev servers (xeon), but
happens on another (pentium). Is there some type of hardware limitation? I
have tried sql server developer SP4 and enterprise Sp4 - same issues occur on
the same machine
b) inconsistency #2: if I restart the sql server service, the update
statement works fine from both query analyzer and from the ado.net app. The
minute I run a select statement against this table, the update statement
subsequently hangs. I've checked the active connections and they're not
running excessivley.

what am I missing?

thx
Avi
2/13/2006 9:58:29 PM
Uri

The database is tiny. The test table I am using has just 1 record in it.
Further, the situations where this works, the database is much larger with
many more records. So its not a size issue.

My original statement was a simple SQL UPDATE statement (not even using the
UPDATETEXT / WRITETEXT approach). It makes no difference where I execute
this from (ado.net, query analyzer etc), the SQL SERVER will hang regardless.
Here is an example of the statement:

Update myTable set BigNTextField = N'.....long text string here.....' where
id=12345

Avi

[quoted text, click to view]
Avi
2/13/2006 10:48:27 PM
Yes. I understand it works fine. The problem is that there is some
inconsistency. Hence the title "strange".

[quoted text, click to view]
Uri Dimant
2/14/2006 12:00:00 AM
Avi
I did some testing and it worked fine (SS2000, Personal Edition ,SP3)



create table tmp(pkid int identity,txt text)

insert tmp select replicate('a',8000)

select * from tmp

go
create proc myusp
@t1 text,
@t2 text,
@pkid int
as
set nocount on

--overriding the current text
update tmp
set txt=@t1
where pkid=@pkid

--usage
declare @1 varchar(8000),@2 varchar(5555)
select @1=replicate('b',8000),@2=replicate('c',5555)
Exec myusp @1, @2, 1






[quoted text, click to view]

Uri Dimant
2/14/2006 12:00:00 AM
Hi,Avi

I'm not a MVP , however if you post DDL+ sample data I could suggest you
something.

What is the error you are getting?
How big is your database?
Have you looked at an execution plan of the query? Does an optimizer use
indexes defined on the table?


[quoted text, click to view]

Jim Underwood
2/15/2006 9:39:30 AM
Have you checked for locks on the data you are updating?

You say this does not happen on two dev servers, but does happen on the
third. Are you talking about 3 different databases running on each of these
servers, or and application running on each?
[quoted text, click to view]

AddThis Social Bookmark Button