Welcome to SQLDBcontrol Forums Sign in | Join | Help
in

conversion error in table update script

Last post 07-24-2008, 12:17 by admin. 1 replies.
Sort Posts: Previous Next
  •  07-24-2008, 12:17 213

    conversion error in table update script

    We have a trigger that moves data from a column of type varchar(11) to one of type money. This worked in SQL 2005 and errors in 2000. When I tried to modify the table on the 2000 server I got the same error for the change because it is a 2000 box:-

     

    SQLDBcontrol

    Version: 2.0.10000

     

    Unhandled Exception:

     

    Disallowed implicit conversion from data type char to data type money, table 'ETL.dbo.tmp_1_T_VM_CREDITS', column 'VALUE'. Use the CONVERT function to run this query.

     

    System.Data.SqlClient.SqlException

     

    Stack Trace:

       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)

       at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)

       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)

       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)

       at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async)

       at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe)

       at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()

       at Microsoft.SqlServer.Management.Common.ServerConnection.ExecuteNonQuery(String sqlCommand, ExecutionTypes executionType)

  •  07-25-2008, 9:01 214 in reply to 213

    Re: conversion error in table update script

    This problem has been fixed for the next build.  SQL 2005 implicitly converts money and varchar datatypes, whereas SQL 2000 doesn't.  We've also made sure that other datatypes that require explicit conversions are handled correctly.
    SQLDBcontrol Support

    support@sqldbcontrol.com
View as RSS news feed in XML
Powered by Community Server, by Telligent Systems