Then just before you import the product spreadsheet you run the update statement from my post above to actually append the ids to the category names, do the import, then run the second sql statement to remove the ids you appended to the names. You run that, take the result and do all the matching in your external spreadsheet to get the file ready for import using the category names with id's appended. Name + '_' + CAST(Id AS nvarchar(11)) AS Name,ĭ.Name + '_' + CAST(d.Id AS nvarchar(11)),Ĭeepath + ' > ' + CAST(d.Name AS nvarchar(1024))ĩ2 Accessories_92 4 1 Peripherals > Accessoriesĥ4 Chargers_54 92 2 Peripherals > Accessories > Chargers So something like this should give you what you need: I'm not sure I understand completely but you just need to get the data out in a way that allows you to match up to the format that you've got in your external file (the treepath in your query) and with the category ids appended to the names so that you can match them back.
IMPORT JHELIOVIEWER DATA TOPCAT CODE
The code i have so far doesnt really work as it removes the "maincat" completly. what i want to do is to have the new data appear on the top rather than having in on the bottom of the page and i have to continuously scroll down to see the new data. Issue is, when i use your update query to update the catageory names with there IDs, i need to make an additional column that wont contain them so i can still apply the join. I am trying to import data from another computer that continuously gets new data. For example, the screenshot below, shows a folder called images, which contains all of the slide JPEGs. You can upload the images directly into the root directory, or you can upload the images inside a subfolder. Drag-and-drop your files into the File Repository. SELECT d.id AS catid, d., d.ParentCategoryId,categorycte. Go to (Admin) > Go To Module > File Content. UNION ALL -and now for the recursive part WHERE ParentCategoryId = 0 and Deleted = 0 ( SELECT id AS catid,, ParentCategoryId, 0 AS LEVEL,ĬAST( AS VARCHAR(1024)) AS treepath,ĬAST( AS VARCHAR(1024)) AS treepathscrubbed WITH categorycte(,, ParentCategoryId,, treepath, treepathscrubbed) AS Issue is, when i use your update query to update the catageory names with there IDs, i need to make an additional column that wont contain them so i can still apply the join. Which is fine, i can then query wehre the 2 fields are equal. The CTE query has the treepath field with data like I have my data in a table with a extrea firld called treenode.