- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
SELECT TOP 1
Fak_Beholdning_Id,
ETL_Batch_ID,
ETL_Kilde_ID
INTO #Delete
FROM
dv.FAK_Beholdning
WHERE ETL_Batch_ID = 20120522
AND ETL_Kilde_Id = 678
AND ETL_Lastefrekvens_txt = 'Daglig'
IF (SELECT count(*) FROM #Delete) = 1
BEGIN
DELETE FROM dv.Fak_Beholdning
WHERE ETL_Batch_ID = (Select ETL_Batch_ID FROM #Delete)
AND ETL_Kilde_Id = (Select ETL_Kilde_ID FROM #Delete)
AND ETL_Lastefrekvens_txt = 'Daglig'
END
DROP TABLE #Delete
Удаление с проверкой, чо...
*рукалицо*
Комментарии (0) RSS
Добавить комментарий