Jun 27 2022 12:14 PM
I'm using the built-in "New list --> From existing list" copy feature and trying to copy a very simple list. The problem is that this list contains a lookup to another list, and that list contains a lookup to this list. I.E. Both lists refers to the other list
When copying I get the following error:
Parameter targetListName references a resource that could not be found..Parameter targetListName references a resource that could not be found
The lists looks like this
List1
Title
LookUpColumn --> List2.Title
List2
Title
LookUpColumn --> List1.Title
Any idea how to copy lists like this.
Does ShareGate support copying
Jun 27 2022 10:23 PM
SolutionJun 28 2022 02:06 AM - edited Jun 28 2022 02:09 AM
@Juan Carlos González Martín Thanks a lot.
Transforming this to the SQL doamin. This is what Microsofts built in tool are trying to do:
CREATE TABLE [dbo].[Table10]
(
[Id] INT NOT NULL PRIMARY KEY, -- Primary Key column
[Title] NVARCHAR(50) NOT NULL,
[LookupColumn] INT NULL REFERENCES Table20 (Id) -- Foreign Key to table20
);
GO
CREATE TABLE [dbo].[Table20]
(
[Id] INT NOT NULL PRIMARY KEY, -- Primary Key column
[Title] NVARCHAR(50) NOT NULL,
[LookupColumn] INT NULL REFERENCES Table10 (Id) -- Foreign Key to table10
);
GO
While what they should be doing is this:
CREATE TABLE [dbo].[Table1]
(
[Id] INT NOT NULL PRIMARY KEY, -- Primary Key column
[Title] NVARCHAR(50) NOT NULL,
[LookupColumn] INT NULL
);
GO
CREATE TABLE [dbo].[Table2]
(
[Id] INT NOT NULL PRIMARY KEY, -- Primary Key column
[Title] NVARCHAR(50) NOT NULL,
[LookupColumn] INT NULL
);
GO
ALTER TABLE Table1
ADD FOREIGN KEY (LookupColumn) REFERENCES Table2 (Id);
GO
ALTER TABLE Table2
ADD FOREIGN KEY (LookupColumn) REFERENCES Table1 (Id);
GO
Then... One could ask why anyone would like to create a design like this with circular references, but that's another question :)
Jun 27 2022 10:23 PM
Solution