Readme for Spatial Storage
February 13, 2009
This sample works only with SQL Server 2008. It will not work with any version of SQL Server earlier than SQL Server 2008.
This sample inserts two rows into a table with a geography column from a WellKnownBinary (WKB) using 2 different bindings (SQLC
CHAR and SQLC
BINARY). Then it selects one row from that table and uses ::STAsText()
to display it.
The WKB is 0x01010000000700ECFAD03A4C4001008000B5DF07C0 and the application prints to the console: POINT(56.4595 -2.9842).
This sample does not require an ODBC data source, but the sample runs, by default, on the local instance of SQL Server.
SQL Server samples and sample databases must be downloaded and installed before you can view or work with them. For more information, see Considerations for Installing SQL Server Samples and Sample Databases
For more information about spatial storage, see Designing and Implementing Spatial Storage
in SQL Server Books Online.
This sample uses Visual C++.
Before running this sample, make sure that the following software is installed:
- SQL Server or SQL Server Express, including Database Engine. You can download SQL Server Express from the Microsoft Download Center.
- The SQL Server Database Engine samples that are available at the Microsoft SQL Server Developer Center.
- .NET Framework SDK 2.0 (or later) or Microsoft Visual Studio 2005 (or later). You can obtain .NET Framework SDK free of charge. For more information, see Installing the .NET Framework Documentation.
- The source code for this sample. Click on the Releases tab above then click on either the appropriate installer for the computer you are using or click on the zip file for any machine architecture.
Building the Sample