This project is read-only.

Importing Shp file

Nov 3, 2008 at 5:03 PM

When I try to import the shp files I get the following error for command line: 

C:\Downloads\MsSQLSpartial\MsSqlSpatial-0.1.1>msscmd.exe -server=themmaya\sqlexp
ress  -db=bwconstituents  -table=tbl_stands -column=the_geom  -import=shp  -shp_
filename="C:\DEVELOPMENT\GIS\Botswana\South East\South East\BOT-7.shp"

Unhandled Exception: System.Data.SqlClient.SqlException: Incorrect syntax near '
-'.
   at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolea
n breakConnection)
   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception
, Boolean breakConnection)
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObj
ect stateObj)
   at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cm
dHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, Tds
ParserStateObject stateObj)
   at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName,
Boolean async)
   at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult res
ult, String methodName, Boolean sendToPipe)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at MsSqlSpatial.GeometryTable.ExecuteCreate(SqlCommand command, String schema
Name, String tableName, String columnName, String createColumns)
   at StoredProcedures.ImportFromDatasource(IProvider datasource, String schemaN
ame, String tableName, String columnName, Int32 srid, String type, String connec
tionString, ImportFromDatasourceProcess process, Int32& importedRows, TimeSpan&
elapsedTime)
   at StoredProcedures.ImportFromShapefileMain(String shapefile, String schema_n
ame, String table_name, String column_name, Int32 srid, String type, String conn
ectionString, Int32& importedRows, TimeSpan& elapsedTime)
   at MsSqlSpatialConsole.Program.ImportShp(ArgParser arg, String schema, String
 table, String column, Int32 srid, String type, String connectionString)
   at MsSqlSpatialConsole.Program.Main(String[] args)

-------------------------------------
Where m I getting it wrong on th syntax.  


 

 

 

 

 

 

Nov 4, 2008 at 10:12 AM
Hi konzab, just a guess but try renaming the shapefile/dbf/etc , remove the '-' character hth jd