IF EXISTS(SELECT * FROM [Configuration] WHERE [Key_Name] = 'Diagnostics.DbVersion') UPDATE [Configuration] SET [Value_Text] = '$ReleaseNumber.$BuildNumber' WHERE [Key_Name] = 'Diagnostics.DbVersion' ELSE INSERT INTO [Configuration] ([Key_Name], [Value_Text]) VALUES ('Diagnostics.DbVersion', '$ReleaseNumber.$BuildNumber')