USP_SITECONTENT_BULKMOVE
Parameters
Parameter | Parameter Type | Mode | Description |
---|---|---|---|
@XML | xml | IN | |
@FOLDERID | int | IN |
Definition
Copy
CREATE procedure dbo.USP_SITECONTENT_BULKMOVE
(
@XML xml,
@FOLDERID int
)
as
begin
set nocount on
declare @SiteContentIDS table ([SiteContentID] int)
insert into @SiteContentIDS select IDS.ID.value('.', 'int') from @XML.nodes('/SiteContent/id') IDS(ID)
if @FOLDERID > 0
begin
merge into dbo.SITECONTENTFOLDERS as TARGET
using @SiteContentIDS as SOURCE
on TARGET.ContentID = SOURCE.SiteContentID
when matched then
update set SITEFOLDERSID = @FOLDERID
when not matched by target then
insert (CONTENTID, SITEFOLDERSID) values (SiteContentID, @FOLDERID);
end
else
begin
delete dbo.SITECONTENTFOLDERS
from dbo.SITECONTENTFOLDERS SCF
inner join @SiteContentIDS SCI on SCI.SiteContentID = SCF.ContentID
end
end