I have to identical (same structure) SQL 2000 tables in two different databases. I need to copy a data from one table to another.
Source Table:
ID Name Descr Enabled
0 D_1 1
1 D_2 1
2 D _3 1
3 D _4 1
4 SomeName 0
Target Table:
ID Name Descr Enabled
0 C_1 - 0
1 C_2 - 0
2 C_3 - 0
3 C_4 - 0
4 C_5 - 0
5 C_6 - 1
Desired result (after copy of source to target):
ID Name Descr Enabled
0 D_1 1
1 D_2 1
2 D _3 1
3 D _4 1
4 SomeName 0
5 C_6 - 1
I tried the following query:
Update targetDB.dbo.TargetTable
Set targetDB.dbo.TargetTable.N
ame= sourceDB.dbo.sourceTable.N
ame
From sourceDB.dbo.sourceTable
Where sourceDB.dbo.sourceTable.I
D= targetDB.dbo.sourceTable.I
D
But I got an error:
Subquery returned more than 1 value. &
Any ideas how it can be done?
Start Free Trial