AND ArchivedTime is null OPEN relations FETCH NEXT FROM relations INTO @relation WHILE @fetch_status = 0 BEGIN - Renommer ...

'
                  AND ArchivedTime is null
                  OPEN relations
                  FETCH NEXT FROM relations INTO @relation
                  WHILE @@fetch_status = 0
                  BEGIN
                  -- Renommer les colonnes
                  SET @tableChangeSql = N'EXEC sp_rename N''' + @relation + N'.[OtherActivityName]'', ''ReferenceName'', ''COLUMN'''
                  EXEC sp_executesql @tableChangeSql

                  SET @tableChangeSql = N'EXEC sp_rename N''' + @relation + N'.[OtherActivityID]'', ''ReferenceData'', ''COLUMN'''
                  EXEC sp_executesql @tableChangeSql

                  -- Ajouter deux nouvelles colonnes : ReferenceType et LongReferenceData
                  SET @tableChangeSql = N'ALTER TABLE ' + @relation + N' ADD ReferenceType NVARCHAR(128) DEFAULT N''BizTalkService'' WITH VALUES, LongReferenceData NTEXT NULL'
                  EXEC sp_executesql @tableChangeSql

                  -- Mettre à jour ReferenceType sur 'Activity' lorsque OtherActivityName n'est pas 'BizTalkOrchestration'
                  SET @tableChangeSql = N'UPDATE ' + @relation + N' SET ReferenceType = N''Activity'' WHERE ReferenceName <> N''BizTalkOrchestration'''
                  EXEC sp_executesql @tableChangeSql
                  
                  -- Mettre à jour ReferenceType sur 'BizTalkService' lorsque OtherActivityName est 'BizTalkOrchestration'
                  -- Mettre à jour ReferenceName sur serveur de gestion + base de données de gestion + relation
                  SET @tableChangeSql = N'UPDATE ' + @relation + N' SET ReferenceName = N''' + @ReferenceName + N''' WHERE ReferenceName = N''BizTalkOrchestration'''
                  EXEC sp_executesql @tableChangeSql

              FETCH NEXT FROM relations INTO @relation
          END

          CLOSE relations
          DEALLOCATE relations
          GO

          -- Espace réservé, sera modifié dans le code
          ALTER VIEW
English
English (United States)
Deutsch (Deutschland)
German (Germany)
Español (España)
Spanish (Spain)
Français (France)
French (France)
日本語
Japanese
한국어
Korean