-- dbo.ET_hdc_ph_PrijataJsonData_D
CREATE TRIGGER dbo.ET_hdc_ph_PrijataJsonData_D ON dbo._hdc_ph_PrijataJsonData
WITH EXECUTE AS CALLER
FOR DELETE
AS
BEGIN
 SET NOCOUNT ON

-- !! trigger neupravujte, bude stejne pregenerovan pri startu pluginu HDCDZAPI !!

 DECLARE
  @id INT


 IF NOT EXISTS(SELECT 1 FROM dbo._hdc_ph_PrijataJsonData)
   TRUNCATE TABLE dbo._hdc_ph_PrijataJsonData
  ELSE
   BEGIN
    SELECT @id=MAX(ID) FROM dbo._hdc_ph_PrijataJsonData
    DBCC CHECKIDENT (_hdc_ph_PrijataJsonData, RESEED, @id)
   END


END
