MsSqlSpatial Command Line Tool
------------------------------

USAGE:

MsSqlSpatialConsole [options]

DEFAULT VALUES:

    Options marked with the text [Default from config] use the values set
    in msscmd.exe.config file if they are omitted or left blank.

COMMANDS:

-help                    : Display this help text. Shortcuts: -h and -?

-deploy                  : Deploy assembly and associated objects to SQL Server
                           database. CLR Integration must be enabled before.

-deploy_permission=value : Set assembly permission which can be either SAFE, 
                           EXTERNAL_ACCESS or UNSAFE. The stored procedures for
                           importing/exporting will require EXTERNAL_ACCESS or
                           UNSAFE permission. 
                           Use SAFE if you don't have enough privileges.
                           [Default from config]

-undeploy                : Remove assembly and associated objects 
                           from SQL Server database.

-import=value            : Import from datasource to SQL Server. 
                           Valid values are SHP and PGSQL.

-export=value            : Export to datasource from SQL Server.
                           Valid values are SHP and PGSQL.

SQL SERVER CONNECTION OPTIONS:

-server=value            : SQL Server address and instance. 
                           [Default from config]
-db=value                : SQL Server database name.
                           [Default from config]
-login=value             : SQL Server login name. If not specified, it uses
                           Windows authentication (SSPI).
                           [Default from config]
-password=value          : SQL server login password.

IMPORT/EXPORT OPTIONS:

-schema=value            : SQL Server schema name. [Default from config]
-table=value             : SQL Server table name.
-column=value            : SQL Server geometry column name.
                           [Default from config]
-srid=value              : SRID to be used as constraint for SQL Server geometry
                           column. [Default from config]

-shp_filename=value      : Shapefile used for importing to or exporting from
                           SQL Server.

-pgsql_server=value      : PostGIS server address. [Default from config]
-pgsql_port=value        : PostGIS server port. [Default from config]
-pgsql_db=value          : PostGIS database name. [Default from config]
-pgsql_login=value       : PostGIS login name. [Default from config]
-pgsql_password=value    : PostGIS login password.
-pgsql_schema=value      : PostGIS schema name. [Default from config]
-pgsql_table=value       : PostGIS table name.
-pgsql_geom_column=value : PostGIS geometry column name. [Default from config]
-pgsql_oid_column=value  : PostGIS primary key column name. 
                           [Default from config]


EXAMPLES:

* Deploy using Windows authentication (omit -login and -password):

	msscmd -deploy -server=mssql_server -db=mssql_database

* Deploy using SQL Server authentication:

	msscmd -deploy -server=mssql_server -db=mssql_database -login=username password=password

* Import from shapefile:
	
	msscmd -server=mssql_server -db=mssql_database -table=mssql_table -import=shp -shp.filename="C:\..\..\shapefile.shp"

* Import from PostGIS table:
	
	msscmd -server=mssql_server -db=mssql_database -table=mssql_table -import=pgsql -pgsql_password=source_password -pgsql_db=source_db -pgsql_schema=source_schema -pgsql_table=source_table

Last edited Aug 24, 2006 at 12:26 AM by rstuven, version 2

Comments

No comments yet.