use SN7_SERVER_SCHEMA;

ALTER TABLE UAREPLACEMENTSTRING DROP CONSTRAINT FK_UAREPLAC_REFERENCE_UA
GO

TRUNCATE TABLE UA
GO

TRUNCATE TABLE UAREPLACEMENTSTRING
GO

ALTER TABLE UA DROP CONSTRAINT FK_UA_REFERENCE_UACONFIR
GO

TRUNCATE TABLE UACONFIRMATION
GO

ALTER TABLE REPLACEMENTSTRING DROP CONSTRAINT FK_REPLACEM_REFERENCE_EVENTLOG
GO

TRUNCATE TABLE EVENTLOGREC
GO

TRUNCATE TABLE REPLACEMENTSTRING
GO

TRUNCATE TABLE SESSIONACTION
GO

ALTER TABLE UAREPLACEMENTSTRING ADD CONSTRAINT FK_UAREPLAC_REFERENCE_UA FOREIGN KEY (UAID) REFERENCES UA (UAID) ON DELETE CASCADE
GO

ALTER TABLE UA ADD CONSTRAINT FK_UA_REFERENCE_UACONFIR FOREIGN KEY (UACONFIRMATIONID) REFERENCES UACONFIRMATION (UACONFIRMATIONID)
GO

ALTER TABLE REPLACEMENTSTRING ADD CONSTRAINT FK_REPLACEM_REFERENCE_EVENTLOG FOREIGN KEY (EVENTLOGRECID) REFERENCES EVENTLOGREC (EVENTLOGRECID) ON DELETE CASCADE
GO

