Delete Multiple Datasets from Datahub

Following SQL Code block can be used to delete all datasets from an IQSonar Datahub instance.

This will irretrievably delete all information from your iQSonar Datahub


DECLARE @datasetids Table (id INTEGER)

INSERT INTO @datasetids
SELECT datasetid FROM hub.dataset;

DECLARE @dsid INTEGER

WHILE EXISTS (SELECT id FROM @datasetids)
	BEGIN
		SELECT @dsid = min(id) FROM @datasetids
		EXEC dbo.Dataset_de @dsid
		delete FROM @datasetids WHERE id = @dsid
	END