Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • MK 426 posts 902 karma points
    Jun 30, 2014 @ 11:46
    MK
    0

    Cannot insert the value NULL into column 'ForceRedirect'

    Hi there,

    I’ve upgraded from v1 to the latest v2 and I’m getting the following error about every min or so.

    Will appreciate any input on this one.

     

    Moshe

     

    Exception information: Exception type: SqlException Exception message: Cannot insert the value NULL into column 'ForceRedirect', table 'nnn.dbo.icUrlTracker'; column does not allow nulls. INSERT fails. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning() at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteNonQuery(String connectionString, CommandType commandType, String commandText, SqlParameter[] commandParameters) at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Jun 30, 2014 @ 11:51
    Stefan Kip
    0

    What SQL version/edition are you using? For example SQL CE or SQL Server (2008/2012/2014).
    Because the column 'ForceRedirect' should have a Default value of '0'.

  • MK 426 posts 902 karma points
    Jun 30, 2014 @ 12:13
    MK
    0

    Many thanks for the quick reply.

    We have SQL 2012.

  • MK 426 posts 902 karma points
    Jun 30, 2014 @ 16:00
    MK
    0


    Hi,

    Ive set the default value to 0 and now Im getting the following:

     

    Exception message: Cannot insert the value NULL into column 'RedirectHttpCode',

    Do I need to set a default value here as well?

    Many thanks

    Moshe

  • Stefan Kip 1606 posts 4098 karma points c-trib
    Jun 30, 2014 @ 16:06
    Stefan Kip
    100

    Yes you can see what the defaults are over here:

    https://github.com/kipusoep/UrlTracker/blob/master/SQL/create-table-1.sql

  • MK 426 posts 902 karma points
    Jun 30, 2014 @ 16:15
    MK
    0

    Great . Seems fine for now.

    Many thanks

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies