I have to update a column of table 1 for selected records.
Actually its a sort of inner join on table1 and table2. and we have to update colm1 of table1.
Queries used:
1.
Update Table1 A
Set A.Colm1 = 'X'
Where exists
( Select 1 from Table2 B
where B.colm2 = A.colm2 and
A.com1 = 'Y'
)
2.
Update Table1 A
Set A.Colm1 = 'X'
Where A.colm1 = 'Y' and
A.colm2 in
( Select distinct C.colm2
from Table2 B , Table1 C
where B.Colm2 = C.colm2 and
C.colm1 = 'Y'
)
When I ran both above queries in SPUFI, I received -911.
The 1st query is a corellated sub query, so may be its hitting the deadlock state.
In case of 2nd query I am a bit confused. The inner sub query has no relation with outer one.
I tried to search for this query on google.
I found few links but none seems to be working. It looks like SQL server, MS-Access do have some support for these type of queries.
Some good news is here.
The problem is fixed. I used the the first query.
1.
Update Table1 A
Set A.Colm1 = 'X'
Where exists
( Select 1 from Table2 B
where B.colm2 = A.colm2 and
A.com1 = 'Y'
)
This was giving -911 while running via SPUFI. This may be because of Timeout.
When I ran the same query in Batch SPUFI.
It worked absolutely fine.