January 28, 2010 at 8:58 am
I run the following queries:
select top 10 LINKED_FLG,IMAGE_ACCOUNT_NUMBER
from FACT_TXN_INFO
where DATE_ID = 20100127
and stack_number = 1
and txn_type_id = 27
update FACT_TXN_INFO
set IMAGE_ACCOUNT_NUMBER = 'stephen'
where DATE_ID = 20100127
and stack_number = 1
and txn_type_id = 27
select top 10 LINKED_FLG,IMAGE_ACCOUNT_NUMBER
from FACT_TXN_INFO
where DATE_ID = 20100127
and stack_number = 1
and txn_type_id = 27
update FACT_TXN_INFO
set LINKED_FLG = 0
where DATE_ID = 20100127
and stack_number = 1
and txn_type_id = 27
select top 10 LINKED_FLG,IMAGE_ACCOUNT_NUMBER
from FACT_TXN_INFO
where DATE_ID = 20100127
and stack_number = 1
and txn_type_id = 27
And the result is so unexpected.
LINKED_FLG IMAGE_ACCOUNT_NUMBER
---------- ---------------------
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
(10 row(s) affected)
(20392 row(s) affected)
LINKED_FLG IMAGE_ACCOUNT_NUMBER
---------- ---------------------
0 stephen
0 stephen
0 stephen
0 stephen
0 stephen
0 stephen
0 stephen
0 stephen
0 stephen
0 stephen
(10 row(s) affected)
(20392 row(s) affected)
LINKED_FLG IMAGE_ACCOUNT_NUMBER
---------- ---------------------
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
0 NULL
(10 row(s) affected)
I update the field 'IMAGE_ACCOUNT_NUMBER' to 'Stephen' (it is a varchar(20))
and then update the field 'LINKED_FLG' to 0 (it is a bit)
But after the update, the previous update value is gone!!
ANY IDEA why it happens like this
January 28, 2010 at 9:35 am
Are there any triggers on the table?
January 28, 2010 at 9:48 am
No trigglers and purely no index on these two fields
January 28, 2010 at 9:53 am
Have you run a SQL trace? That should tell you exactly what is updating your column values to NULL.
January 28, 2010 at 10:06 am
everything look normal in the trace.
nothing happening 🙁
January 28, 2010 at 10:41 am
I would recommend making sure you have your trace configured correctly. The trace will capture all SQL activity. All changes to data whether from SP, trigger code, or a simple SQL batch will escape the Trace if properly configured.
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply