CREATE PROCEDURE [dbo].[spAddRootRecord]
(
@SiteId int
)
AS
BEGIN
SET NOCOUNT ON;
if not exists (SELECT Id FROM tblContent WHERE SiteID = @SiteID and ContentType = '1')
BEGIN
-- Create Root record in tblContent:
INSERT INTO tblContent (ParentId,TemplateId,SiteId,[Name],ContentType)
VALUES
(NULL,'1',@SiteId,'Nettside','1')
END
END
|