Copied to clipboard

Flag this post as spam?

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


  • Michael Cazzarolli 16 posts 37 karma points
    Mar 20, 2012 @ 11:00
    Michael Cazzarolli
    0

    Date problem in DB migration from Webmatrix

    Hi guys!

    I'm trying to move an Umbraco website's DB from SQL Compact to SQL Server from WebMatrix, but I'm having a problem.

     

    This is the error: "The conversion of a varchar data type to a datetime data type resulted in an out-of-range value"

    This is two query strings I got from checking SQL Profiler, this is what WebMatrix is trying to do.

    This one works:

    INSERT INTO [dbo].[cmsContentVersion]([id],[ContentId],[VersionId],[VersionDate]) VALUES (37,1048,'b1c6cb2b-7a9a-421e-99ca-6013d157ba9d','2012-03-12 12:10:29.853')

    While this one doesn't. This is where the migration stops.

    INSERT INTO [dbo].[cmsContentVersion]([id],[ContentId],[VersionId],[VersionDate]) VALUES (38,1048,'cf7cb196-5f79-4743-8fb6-d8334a2119e9','2012-03-19 11:04:43.233')

    If you check the dates, the format is YYYY-MM-DD, the first '2012-03-12' is accepted 'cause it looks like it is YYYY-DD-MM (03, and 12 could both be a day or a month), but the second one doesn't, cause 19 can't be a month, so the format is clearly YYYY-MM-DD.

    So I'm guessing  there's a problem at some point where SQL wants a YYYY-DD-MM format, and I'm providing a YYYY-MM-DD format, so I tried editing the language options on my SQL server installation ('cause that's the only way I know to change date format), but no luck so far.

     

    Thanks in advance!!

    I'm using the latest build of Umbraco, Webmatrix and SQL Server 2008 R2.

  • Michael Cazzarolli 16 posts 37 karma points
    Mar 27, 2012 @ 17:38
    Michael Cazzarolli
    0

    bumpity bump?

Please Sign in or register to post replies

Write your reply to:

Draft