Bonjour,
Est-il possible de réaliser cette suite de requete automatiquement tous les jours à une heure prévue. Je doit contrôler tous les jours ma base, pour voir si il n'y pas de doublons.
Merci de votre aide
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 ALTER TABLE [MIS_SERVER_CDGA].[dbo].[MfProd] ADD COLUID uniqueidentifier UPDATE [MIS_SERVER_CDGA].[dbo].[MfProd] SET COLUID = NEWID() DELETE FROM [MIS_SERVER_CDGA].[dbo].[MfProd] WHERE COLUID > ANY (SELECT COLUID FROM MfProd T2 WHERE MfProd.COLUID <> T2.COLUID AND MfProd.Dates = T2.Dates AND MfProd.timerbagscan = T2.timerbagscan AND MfProd.nommachine = T2.nommachine AND MfProd.ipmachine = T2.ipmachine AND MfProd.timertag = T2.timertag AND MfProd.tag = T2.tag AND MfProd.timerMfdec = T2.timerMfdec AND MfProd.MfDec = T2.MfDec AND MfProd.timerSendB = T2.timerSendB AND MfProd.nomduposte = T2.nomduposte AND MfProd.ipduposte = T2.ipduposte AND MfProd.numerodecontrole = T2.numerodecontrole AND MfProd.timerWsRcv = T2.timerWsRcv AND MfProd.numeroidentification = T2.numeroidentification AND MfProd.timerWssho = T2.timerWssho AND MfProd.timerWsDec= T2.timerWsDec AND MfProd.WsDec = T2.WsDec ) ALTER TABLE MfProd DROP COLUMN COLUID
Partager