Robert,
 
I have mingling with SpatialWare as well. This idea is more SQL Server than SpatialWare based.
 
I designed a number of stored procedures and user defined functions and kept these in a simple text file, so that it was easy for me to recreate the entire database from scratch. When you do this you have the same kind of probem: the stored might and might not exist.
 
So before creating a stored procedure - or what ever - I check to see if it exists:
 
********************************************
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[spDAV_VRR_INS]') and OBJECTPROPERTY(id, N'IsProcedure') = 1)
 drop procedure [dbo].[spDAV_VRR_INS]
GO
 
CREATE PROCEDURE [dbo].[spDAV_VRR_INS]
 @nVME_ID int,
 @nRNR_ID int
AS
...
********************************************
 
I sure you can use the same check to see if the rtree has been created.
 
or you could use this stored procedure (I just found it in the documentation for SpW 4.8):
 
Verifying Your Table has an R-Tree Index
You can check if a table has an R-tree index by using the R-Tree Is Created procedure (sp_sw_rtree_is_created). The syntax for this procedure is:
exec sp_sw_rtree_is_created '<owner>', '<table_name>', '<spatial_column>', '<key_column>', @truth = <truth_parameter> output

HTH,

Peter Horsbøll Møller
GIS Developer, MTM
Geographical Information & IT
 
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
 
Tel     +45 6311 4900
Direct  +45 6311 4908
Mob     +45 5156 1045
Fax     +45 6311 4949
E-mail  [EMAIL PROTECTED]
http://www.cowi.dk/gis

"For enden af regnbuen..." - hvordan kommer man dertil og er det overhovedet muligt?
Læs mere om årets MapInfo konference på www.cowi.dk/mapinfokonference

 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Robert Crossley
Sent: Saturday, September 02, 2006 11:58 PM
To: mapinfo-l@lists.directionsmag.com
Subject: [MI-L] Spatialware Drop RTREE

Hi any spatialware gurus,

 

When things go right, spatialware has been working well.  However, when I get something go wrong, it can trigger a whole sequence of issues, eg. if  one of the stored procedures fails midway, I may have dropped the rtree index in a stored procedure  and not recreated it at the end. Then the next time I run the stored proc, I get an error saying that I cannot run the stored procedure as I get the error.

 

[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot drop the function 'dbo.T_GPS_LOCS#p#SW_GEOMETRY#p#SW_MEMBER', because it does not exist in the system catalog.

 

Then worse, I get the following error because SQL server has stopped.

 

Connection Error was: [Microsoft][ODBC SQL Server Driver][Shared Memory]SQL Server does not exist or access denied.

 

I have seen a number of stored procs in the database like sp_sw_predrop_rtree, sp_sw_rtree_is_precreated, and thought that perhaps these could be used to check before I run the drop rtree procedure.  I am not sure how to though.  It would be better if these sort of checks were simply included in the create rtree stored proc…..

 

Any suggestions?

 

TIA.

 

R

 

-------------------------------------------
Robert Crossley
Agtrix P/L Australia

Far Southern Queensland Office:
Unit 6/ 2 Bonanza Drive
PO Box 63
New Brighton
2483

P: 61 2 6680 1309
F: 61 2 6680 5214
E:
[EMAIL PROTECTED]
W: www.agtrix.com

Brisbane Office:
109 Milsom St
Cooparoo 4151
Queensland
P: 61 7 3843 3363

 

_______________________________________________
MapInfo-L mailing list
MapInfo-L@lists.directionsmag.com
http://www.directionsmag.com/mailman/listinfo/mapinfo-l

Reply via email to