p> Для опису використовується мова запитів до БД - SQL.
Крок № 1. Прийом фактур .
if exists (select * from [OBMEN]. dbo.sysobjects where id = object_id (N '[dbo]. [FAKTURA_250]'))
drop table [OBMEN]. [dbo]. [FAKTURA_250]
SELECT *
INTO [OBMEN]. Dbo.FAKTURA_250
FROM POSEIDON .. OTL_ZANAR.FAKTURA_250
WHERE (STDT> GETDATE () -60 OR STIZ> GETDATE () -35) AND (UKPR = 1 OR UKPR = 3)
Крок № 2. Прийом позицій .
if exists (Select * from [OBMEN]. Dbo.sysobjects where id = object_id (N '[dbo]. [POZICIA_250]'))
drop table [OBMEN]. [Dbo]. [POZICIA_250]
SELECT *
INTO [OBMEN]. Dbo.POZICIA_250
FROM POSEIDON .. OTL_ZANAR.POZICIA_250
WHERE (STDT> GETDATE () -10 OR STIZ> GETDATE () -10) AND (UKPR = 1 OR UKPR = 3)
Крок № 3. Прийом реквізитів .
if exists (Select * from [OBMEN]. Dbo.sysobjects where id = object_id (N '[dbo]. [SHAPKA_250]'))
drop table [OBMEN]. [Dbo]. [SHAPKA_250]
SELECT *
INTO [OBMEN]. Dbo.SHAPKA_250
FROM POSEIDON .. OTL_ZANAR.SHAPKA_250
WHERE (STDT> GETDATE () -10 OR STIZ> GETDATE () -10) AND (UKPR = 1 OR UKPR = 3)
Крок № 4. Прийом експорту .
if exists (select * from [OBMEN]. dbo.sysobjects where id = object_id (N '[dbo]. [EXPORT_250]'))
drop table [OBMEN]. [dbo]. [EXPORT_250]
SELECT *
INTO [OBMEN]. Dbo.EXPORT_250
FROM POSEIDON .. OTL_ZANAR.EXPORT_250
WHERE (STDT> GETDATE () -10 OR STIZ> GETDATE () -10) AND (UKPR = 1 OR UKPR = 3)
Крок № 5. Прийом тех.доп.требованій.
if exists (Select * from [OBMEN]. Dbo.sysobjects where id = object_id (N '[dbo]. [TEXDOPTR_250]'))
drop table [OBMEN]. [Dbo]. [TEXDOPTR_250]
SELECT *
INTO [OBMEN]. Dbo.TEXDOPTR_250
FROM POSEIDON .. OTL_ZANAR.TEXDOPTR_250
WHERE (STDT> GETDATE () -10 OR STIZ> GETDATE () -10) AND (UKPR = 1 OR UKPR = 3)