Home All Groups Group Topic Archive Search About
Author
14 Feb 2005 4:15 AM
Wen Ou

Hi

when I put this update statement
    UPDATE    PContracts
    SET      Status = 'Expire'
    WHERE    DATEDIFF(day, EndDate, GETDATE()) >= 0
in job sql server 2000 and schedules it everyday, it didn't run and produce
a error messege.
Executed as user: GMS_DOM\Administrator. String or binary data would be
truncated. [SQLSTATE 22001] (Error 8152)  The statement has been terminated.
[SQLSTATE 01000] (Error 3621).  The step failed.

but it run well if i used sql quesy analyer

please tell me the reason

thank you in adv

wen ou
Author
14 Feb 2005 11:43 AM
Narayana Vyas Kondreddi
Are you working with the same database and table in Query Analyzer and the
job?

I suggest you look at the length of the Status column and make sure it can
accommodate the word 'Expire'.

More info on this issue at: http://vyaskn.tripod.com/programming_faq.htm#q1
--
HTH,
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @ http://vyaskn.tripod.com/


"Wen Ou" <We***@discussions.microsoft.com> wrote in message
news:418C8033-E839-42AF-B639-A5F7452FEAAD@microsoft.com...
Hi

when I put this update statement
UPDATE PContracts
SET  Status = 'Expire'
WHERE DATEDIFF(day, EndDate, GETDATE()) >= 0
in job sql server 2000 and schedules it everyday, it didn't run and produce
a error messege.
Executed as user: GMS_DOM\Administrator. String or binary data would be
truncated. [SQLSTATE 22001] (Error 8152)  The statement has been terminated.
[SQLSTATE 01000] (Error 3621).  The step failed.

but it run well if i used sql quesy analyer

please tell me the reason

thank you in adv

wen ou

Bookmark and Share

Post Thread options