|
You might also try this coding. -- code -- define the folderPath VALUE @myFolder nvarchar = 'yourfolderpath' -- define the CoordSysytem VALUE @TargetCoordSystem nvarchar = 'yourCoordSystem' -- create a tempTable DROP TABLE [myTemp Table] SELECT * INTO [myTemp Table] FROM ( SELECT r.Name as rName, r.type as rType, o.* FROM [mfd_root] as r INNER JOIN ( SELECT m.mfd_id, m.Name as mName, m.Property as mProperty, m.Value as mValue, n.nName, n.nProperty, n.nValue , n.nMfd_id FROM [mfd_meta] as m INNER JOIN ( SELECT mfd_id as nMfd_id, Name as nName, Property as nProperty , Value as nValue FROM [mfd_meta] WHERE [Property] = 'Folder' AND Value = @myFolder ) as n ON m.Name = n.nName WHERE StringStartsWith(m.Property,'FieldCoordSystem.') = true ) as o ON r.Name = o.mName ) ------------------------------------------ -- UPDATE [mfd_meta] table --> ------------------------------------------ UPDATE ( SELECT m.mfd_id, Property, Value FROM [mfd_meta] as m INNER JOIN [mytemp Table] as t ON m.[mfd_id] = t.[mfd_id] ) SET [Value] = @TargetCoordSystem ------------------------------------ -- DROP TABLE [myTemp Table]
|