I'm required to move every unique row from
TableB, if the unique row from
TableA is not already in
Both tables look the same, they don't have any
keys, but there's a combination of columns that make their rows unique for my task -
num which is an
As my SQL is horrible I wanted to create a script that does the job, but I have ridiculous problems, escaping/handling the
varbinary value. This is why I'm asking for help.
I can pseudo-code..
SELECT * INTO TableB WHERE (unique TableA.num + TableA.com) AND NOT IN (TableB) FROM TableA
afterwards, for moving only
DELETE FROM TableA WHERE (unique from above)
(Working on Microsoft SQL Server Enterprise Edition v9.00.3042.00, i.e. SQL Server 2005 Service Pack 2)
Sorry. I'm still learning SQL AND asking proper questions..
TableB have the same design. They have multiple columns, including the two above mentioned ones. I'm required to both move and copy (depending on the chosen option).
TableA is the source,
TableB is the destination. Both tables may contain numerous occurrences of the same int/com combination. I need to have only one (it doesn't matter which one) of each of the combinations. With copying they're not removed from
TableA, when moving, they should be.