rem BuildSpatialDatabase.bat  -- builds the USGS sample database.
rem
rem Creates the spatial database on the local SQL Server 2005
rem installs the HTM assembly and functions in SpatialDB on the local SQL Server 2005
rem then creates and populates the USGS sample database.
rem  The alternative is to attach the prebuilt database with AttachSpatialDatabase.bat
rem 
rem   create the database
sqlcmd -S "(local)" -E -Q "CREATE DATABASE Spatial"
rem  install the package
sqlcmd -S "(local)" -d Spatial -E -i "C:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\CLR\Spatial\Scripts\spHtmCsharp.sql"
rem  create and populate the USGS tables and the spatial index
sqlcmd -S "(local)" -d Spatial -E -i "C:\Program Files\Microsoft SQL Server\90\Samples\Engine\Programmability\CLR\Spatial\Scripts\SpatialTables.sql"