Section C.2. Step 1: Create a Table to Store Your Business Location Data


C.2. Step 1: Create a Table to Store Your Business Location Data

Let's say you have business locations for which you want to enable proximity searching; in order to do that, you need to have your business listings and their corresponding location information expressed in latitude and longitude coordinates as radians. Once you have that data, you need to create a SQL table (say, BusinessEntity) to store your business listings:

     CREATE TABLE [BusinessEntity] (         [ID] [int] IDENTITY (1, 1) NOT NULL,         [Name] [nvarchar] NOT NULL,         [Latitude] [float] NOT NULL,         [Longitude] [float] NOT NULL, [XAxis] [float] NOT NULL,         [YAxis] [float] NOT NULL,         [ZAxis] [float] NOT NULL,     ) ON [PRIMARY]     GO 

For the sake of simplicity, I'm only showing one property (Name) on the business entity; in reality, you can have as many properties as you want.


Once you created the table successfully, load your data into it using either SQL Data Transformation Services (DTS) or SQL Server Integration Services (SSIS).

The name of the table that you choose in this step is used in the other steps, so if you choose a table name other than BusinessEntity, change the following stored procedures accordingly to match your own name.





Programming MapPoint in  .NET
Programming MapPoint in .NET
ISBN: 0596009062
EAN: 2147483647
Year: 2005
Pages: 136
Authors: Chandu Thota

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net