hi everyone
i have to 4 table and two different database
first db = rotadb
first table =Rota
rota pRotabos ldchangetime
101 6 NULL
102 7 NULL
103 8 NULL
104 9 NULL
105 10 NULL
-------
second table = Rotabos
Rotabos_rowid pRotaBa
6 1
7 2
8 3
9 4
10 5
-------
third table = RotaBa
RotaBa_rowid skod
1 201
2 202
3 203
4 204
5 205
-----------------------------------
and other database =dentime
first table =den
den_rowid skod time
21 201 60
22 202 62
23 203 63
24 204 64
25 205 65
and mycode =
update [rotadb].[dbo].[Rota] set [rotadb].[dbo].[Rota].[ldchangetime] = [dentime].[dbo].[den].[time]
from [dentime].[dbo].[den],[rotadb].[dbo].[Rota] where pRotaBos = (
SELECT [rotadb].[dbo].[RotaBos].[Rotabos_rowid] from [rotadb].[dbo].[RotaBos]
where [rotadb].[dbo].[Rotabos].pRotaBa=(
SELECT [rotadb].[dbo].[RotaBos].[Rotabos_rowid] from [rotadb].[dbo].[RotaBos]
where [rotadb].[dbo].[RotaBos].pRotaBa=(
SELECT [rotadb].[dbo].[RotaBa].[RotaBa_rowid] from [dentime].[dbo].[den], [rotadb].[dbo].[RotaBa]
where [dentime].[dbo].[den].[skod] = [rotadb].[dbo].[RotaBa].[sKod] )))
ERROR =
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
where am i wrong ?