This project is read-only.

exception while ADDGEOMETRYCOLUMN

Topics: Project Management Forum
Jul 9, 2007 at 3:14 AM
when i add an geometry column to add non spatial table with an uniqueidentifier primary key, it throws an exception:

Msg 6522, Level 16, State 1, Procedure AddGeometryColumn, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "AddGeometryColumn":
System.Data.SqlClient.SqlException: Operand type clash: uniqueidentifier is incompatible with int
Transaction count after EXECUTE indicates that a COMMIT or ROLLBACK TRANSACTION statement is missing. Previous count = 1, current count = 0.
System.Data.SqlClient.SqlException:
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnectionSmi.EventSink.ProcessMessagesAndThrow(Boolean ignoreNonFatalMessages)
at Microsoft.SqlServer.Server.SmiEventSink_Default.ProcessMessagesAndThrow(Boolean ignoreNonFatalMessages)
at System.Data.SqlClient.SqlCommand.RunExecuteNonQuerySmi(Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)
at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
at StoredProcedures.ExecuteAddGeometryQueryFunctions(SqlCommand command, String schemaName, String tableName, String columnName)
at StoredProcedures.AddGeometryColumn(SqlString schemaname, SqlString tablename, SqlString column_name, SqlInt32 srid, SqlString type)

where am i wrong? does it mean we must set primary key as integer type?