1

So we migrated dev sql server to 2008.

Our UAT sql server is still 2005.

i had to regenerate my entity framework model for some other reasons, and upon deploying my work to UAT i noticed this error:

cannot find data type datetime2

I profiled the database, and noticed that Entity Framework generated the input parameter as datetime2!

N'@p__linq__0 datetime2(7)',@p__linq__0='9999-12-31 00:00:00'

this executes fine in dev, because datetime2 is a type there. but fails when deployed to environment with 2005.

Is this some sort of known type? Why is entity framework not using regular datetime, and how can i make it cross environment compatible?

perhaps this is not 2008 upgrade related.. but it wasn't an issue before the upgrade and this code has not changed.

1

1 Answer 1

3

Take a look at this 'bug' on MS Connect - the workarounds seem to supply a fairly straightforward fix.

Also covered here.

Sign up to request clarification or add additional context in comments.

1 Comment

MS Connect has been retired, the stackoverflow link looks fine

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.