--=================================================================
--   spSphericalUninstall.sql
--	 2007-06-11 Tamas Budavari
-------------------------------------------------------------------
-- Drops the HTM and Spherical SQL/CLR routines and assemblies
-------------------------------------------------------------------
-- History:
--		2007-10-20: Spherical routines go to schema Sph
-------------------------------------------------------------------

--====================================================================
PRINT '*** DROP ***'
PRINT 'Dropping SQL routines...'
--
BEGIN TRY DROP FUNCTION fHtmVersion END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmEq END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmXyz END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmGetString END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverCircleEq END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverCircleXyz END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmGetCenterPoint END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmGetCornerPoints END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fDistanceEq END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fDistanceXyz END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmEqToXyz END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmXyzToEq END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverRegion END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverRegionError END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverRegionList END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverRegionAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION fHtmCoverBinaryAdvanced END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fGetVersion END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetVersions END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fGetArea END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetArcs END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetOutlineArcs END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetPatches END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetHalfspaces END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetConvexes END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetRegionString END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetRegionStringBin END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fSimplify END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyQuery END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyQueryAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyBinary END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyBinaryAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyString END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fSimplifyStringAdvanced END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fGrow END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGrowArc END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGrowAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fUnion END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fUnionAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fUnionQuery END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fIntersect END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fIntersectAdvanced END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fIntersectQuery END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fDiff END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fDiffAdvanced END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fRegionContainsXYZ END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fConvexAddHalfspace END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP FUNCTION Sph.fGetHtmRanges END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP FUNCTION Sph.fGetHtmRangesAdvanced END TRY BEGIN CATCH END CATCH
--
BEGIN TRY DROP PROCEDURE spSphSyncRegion END TRY BEGIN CATCH END CATCH
BEGIN TRY DROP PROCEDURE Sph.spSyncRegion END TRY BEGIN CATCH END CATCH
--
BEGIN TRY
--	DROP ASSEMBLY [SphericalSql]
	PRINT 'Dropped assembly SphericalSql'
END TRY
BEGIN CATCH END CATCH
--
BEGIN TRY
--	DROP ASSEMBLY [SphericalHTM]
	PRINT 'Dropped assembly SphericalHTM'
END TRY
BEGIN CATCH END CATCH
--
BEGIN TRY
--	DROP ASSEMBLY [SphericalQuickhull]
	PRINT 'Dropped assembly SphericalQuickhull'
END TRY
BEGIN CATCH END CATCH
--
BEGIN TRY
--	DROP ASSEMBLY [Spherical.Quickhull]
	PRINT 'Dropped assembly Spherical.Quickhull'
END TRY
BEGIN CATCH END CATCH
--
BEGIN TRY
--	DROP ASSEMBLY [SphericalIO]
	PRINT 'Dropped assembly SphericalIO'
END TRY
BEGIN CATCH END CATCH
--
BEGIN TRY
--	DROP ASSEMBLY [SphericalLib]
	PRINT 'Dropped assembly SphericalLib'
END TRY
BEGIN CATCH END CATCH
--
