Call now: (800) 766-1884  



 Home


 SQL Server Tips
 SQL Server Training

 SQL Server Consulting
 SQL Server Support
 SQL Server Remote DBA



 Articles
 Services
 SQL Server Scripts
 Scripts Menu



 

 

 

 
 

SQL Server

SQL Server Tips by Gama and Naughter Consulting

 


Testing the Code

To test the XP support, a simple SQL Script called test.sql is located in the XP_GIS directory. We first must register all the XPs as per normal. This can be achieved using:

EXEC master..sp_addextendedproc 'XP_GIS_LL2UTM', 'XP_GIS.dll'
EXEC master..sp_addextendedproc 'XP_GIS_UTM2LL', 'XP_GIS.dll'
EXEC master..sp_addextendedproc 'XP_GIS_DATUMINFO', 'XP_GIS.dll'
EXEC master..sp_addextendedproc 'XP_GIS_ELLIPSOIDINFO', 'XP_GIS.dll'
EXEC master..sp_addextendedproc 'XP_GIS_DISTANCE_BETWEEN', 'XP_GIS.dll'
EXEC master..sp_addextendedproc 'XP_GIS_DATUMTRANSFORM', 'XP_GIS.dll'

Following the registration of the XPs, a number of worked examples are provided to exercise all the functions. For example to obtain the UTM coordinates for the Texas Capitol Building (which is one of the worked examples provided on Peter H. Danas web site) you would use the following code:

DECLARE @Lat float
SELECT @Lat = 30.2746722
DECLARE @Long float
SELECT @Long = -97.74033055
DECLARE @RefEllipsoid int
SELECT @RefEllipsoid = 21
DECLARE @Northing float
DECLARE @Easting float
DECLARE @UTMZone varchar(10)
EXEC master..XP_GIS_LL2UTM @Lat, @Long, @RefEllipsoid, @Northing OUTPUT, @Easting OUTPUT, @UTMZone OUTPUT
PRINT @Northing
PRINT @Easting
PRINT @UTMZone


The above book excerpt is from:

Super SQL Server Systems
Turbocharge Database Performance with C++ External Procedures

ISBN: 0-9761573-2-2
Joseph Gama, P. J. Naughter

 http://www.rampant-books.com/book_2005_2_sql_server_external_procedures.htm

.


 

 

 

Burleson Consulting Remote DB Administration


 

 


 

 

 

 

 
Burleson is the America's Team

Note: The pages on this site were created as a support and training reference for use by our staff of DBA consultants.  If you find it confusing, please exit this page.

Errata?  SQL Server technology is changing and we strive to update our SQL Server support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:and include the URL for the page.
 


Burleson Consulting
SQL Server database support

 

Copyright 1996 -  2013 by Vaaltech Web Services. All rights reserved.

Hit Counter