diff --git a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
index e3ceaba79..054baf7a8 100644
--- a/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
+++ b/WebAPI/LearningHub.Nhs.Database/LearningHub.Nhs.Database.sqlproj
@@ -534,7 +534,7 @@
-
+
diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql
index 2d0cae38b..34ba8ad39 100644
--- a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql
+++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Script.PostDeployment.sql
@@ -69,6 +69,8 @@ END
UPDATE [resources].[ResourceVersion] SET CertificateEnabled = 0 WHERE VersionStatusId <> 1 AND CertificateEnabled IS NULL
+-- do not delete the script AddDigitalLearningSolutionsExternalSystem
+:r .\Scripts\AddDigitalLearningSolutionsExternalSystem.sql
:r .\Scripts\Bookmark.sql
:r .\Scripts\PopulateEventTypes.sql
:r .\Scripts\InternalSystem.sql
diff --git a/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/AddDigitalLearningSolutionsExternalSystem.sql b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/AddDigitalLearningSolutionsExternalSystem.sql
new file mode 100644
index 000000000..4ca9670d4
--- /dev/null
+++ b/WebAPI/LearningHub.Nhs.Database/Scripts/Post-Deploy/Scripts/AddDigitalLearningSolutionsExternalSystem.sql
@@ -0,0 +1,47 @@
+
+-------------------------------------------------------------------------------
+-- Author Colin Beeby
+-- Created 21-03-2024
+-- Purpose Ensure that when a user is associated with external system DigitalLearningSolutionsSso, they are also associated with DigitalLearningSolutions
+--
+-- Modification History
+--
+-- 21-03-2024 ColB Initial Version
+-- 15-11-2024 SA Modified the script to execute check if the trigger exists in the table schema
+-------------------------------------------------------------------------------
+
+-- Check if the trigger exists in the [external] schema and the [ExternalSystemUser] table
+IF NOT EXISTS (SELECT * FROM sys.triggers WHERE name = 'InsertTrigger_AddDigitalLearningSolutionsExternalSystem' AND parent_id = OBJECT_ID('[external].[ExternalSystemUser]'))
+BEGIN
+ -- Create the trigger if it doesn't exist
+ EXEC('
+ CREATE TRIGGER [external].InsertTrigger_AddDigitalLearningSolutionsExternalSystem
+ ON [external].[ExternalSystemUser]
+ FOR INSERT
+ AS
+ BEGIN
+ DECLARE @DigitalLearningSolutionsId INT;
+ DECLARE @DigitalLearningSolutionsSsoId INT;
+
+ -- Get the DigitalLearningSolutions ExternalSystemId
+ SELECT @DigitalLearningSolutionsId = id
+ FROM [external].[ExternalSystem]
+ WHERE code = ''DigitalLearningSolutions'';
+
+ -- Get the DigitalLearningSolutionsSso ExternalSystemId
+ SELECT @DigitalLearningSolutionsSsoId = id
+ FROM [external].[ExternalSystem]
+ WHERE code = ''DigitalLearningSolutionsSso'';
+
+ -- Check if the inserted row has ExternalSystemId matching DigitalLearningSolutionsSsoId
+ IF EXISTS (SELECT 1 FROM inserted WHERE ExternalSystemId = @DigitalLearningSolutionsSsoId)
+ BEGIN
+ -- Insert into ExternalSystemUser table
+ INSERT INTO [external].[ExternalSystemUser]
+ (UserId, ExternalSystemId, Deleted, CreateUserId, CreateDate, AmendUserId, AmendDate)
+ SELECT UserId, @DigitalLearningSolutionsId, Deleted, CreateUserId, CreateDate, AmendUserId, AmendDate
+ FROM inserted;
+ END
+ END;
+ ');
+END;