select paramId from fsenablers..tbl_CUS_WebsiteParameters where paramName = 'portalLoginContentSectionId' select paramValue as sectionId from fsenablers..tbl_CUS_WebsiteConfigurations where paramId = and websiteId = select sectionid from tbl_cmm_sections s inner join fsenablers..tbl_cus_customers c on (s.ownerid = c.fsl_companyid and s.fsl_tablecode = c.fsl_tablecode) inner join fsenablers..tbl_cus_websites w on (c.customerid = w.customerid) where s.ownerId = and s.fsl_tablecode = and w.websiteId = and ( s.section like 'STP - Login%' or s.section like 'Sales Team Portal - Login%' ) order by sectionId set nocount on insert into tbl_CMM_Sections ( section, sectionRank, privateFlag, locked, ownerId, fsl_tablecode ) values( , , , , , ) select sectionId = @@identity set nocount off select itemId from tbl_CMM_Items where ownerId = and fsl_tablecode = and title like '%terms and conditions%' order by itemId set nocount on insert into tbl_CMM_Items ( ownerId, FSL_TableCode, title, text, linkToTarget, fullMemberAccess, unassignedYesNo, sortRank, privateYesNo, unpublishDate, publishDate, newsdate, image ) values ( , , , , , , , , , #CREATEODBCDATE( DATEADD( 'yyyy', 10, now() ) )#, #CREATEODBCDATE( now() )#, #CREATEODBCDATE( now() )#, ) select itemId = @@identity set nocount off select child_attrId from tbl_ORG_AttributeLinks where mstr_attrTypeId = 25 and mstr_attrId = and child_attrTypeId = 24 and child_attrId = set nocount on insert into tbl_ORG_AttributeLinks ( mstr_attrTypeId, mstr_attrId, child_attrTypeId, child_attrId ) values ( , , , ) select child_attrId = @@identity set nocount off delete from fsenablers..tbl_CUS_WebsiteConfigurations where paramId = and websiteId = set nocount on insert into fsenablers..tbl_CUS_WebsiteConfigurations ( websiteId, paramId, paramValue ) values ( , , ) select rowId = @@identity set nocount off select paramValue as sectionId from fsenablers..tbl_CUS_WebsiteConfigurations where paramId = and websiteId = and rowId = --->