Developer forum

Forum » Development » Copying item relation list between languages

Copying item relation list between languages

Jens Mouritzen
Jens Mouritzen
Reply

We need to 'copy' a item relations list to another (2 different language layers). There are no fields in the list to distinguish it from the lannguages, so this is a bit tricky.

How do we achieve this the easiest way? SQL?

2020-02-24_15_25_16-Dynamicweb_Admin.png

Replies

 
Nicolai Pedersen
Reply

This statement will duplicate the rows - and give them a new number. Then you probably have to fix the numbers your self and ensure the numbers are reserved in ItemTypeId table.

insert into itemtype_location values (select CAST(id, int)+10, iteminstancetype, location, sort, ....,  FROM itemtype_location)

BR Nicolai

 
Jens Mouritzen
Jens Mouritzen
Reply

I tried the query below Nicolai, but with no luck:

insert into itemtype_location values (select CAST(id, int)+10, iteminstancetype, location, sort, address, city, zip, name, country, description FROM itemtype_location)

It gave the following error:

Incorrect syntax near the keyword 'select'. Incorrect syntax near '10'

I'm not sure where the error is, since i have not worked much with SQL.
Does the above query distinguish beetween the language layers, and copy them to the right paragraph on the english language layer?

 
Nicolai Pedersen
Reply

Yeah, it was concept only written here outside SQL-Server. You have to fix the sql to be valid...

 

You must be logged in to post in the forum