Parameter or variable @name has invalid data type

  • The attached script is downloaded from APress website for source code for the book "Entity Framework 4.0 Recipes" by Tenny/Hirani. It parses OK, but at runtime throws up a host of errors as seen in the DBErrors.txt file.

    What could be wrong and ho can I correct it?


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • This is a script for 2008 and you are running it in 2005. Everywhere that the date datatype is used needs changing to datetime or smalldatetime. Or see if there is a 2005 version of the script.

  • Thank you, but FYI, I am running SQL Server 2008 R2.


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • Please could you run this and post the result:

    SELECT @@VERSION

  • My God! What next? Could it be I am using SQL Server 2008 R2 and yet querying the version in Management Studio yields: Microsoft SQL Server 2005 - 9.00.2047.00 (Intel X86) Apr 14 2006 01:12:25 Copyright (c) 1988-2005 Microsoft Corporation Express Edition with Advanced Services on Windows NT 6.0 (Build 6001: Service Pack 1)


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • In SSMS click Help -> About and post the Version for Microsoft SQL Server Management Studio.

    I suspect you are using SSMS 2008 R2 but are connecting to a SQL Server 2005 instance. The above will confirm things.

  • Results from Help | About:

    Microsoft SQL Server Management Studio 10.50.1600.1

    Microsoft Analysis Services Client Tools 10.50.1600.1

    Microsoft Data Access Components (MDAC) 6.0.6001.18000

    Microsoft MSXML 3.0 4.0 5.0 6.0

    Microsoft Internet Explorer 7.0.6001.18000

    Microsoft .NET Framework 2.0.50727.3615

    Operating System 6.0.6001

    Hope it helps to clarify the issue?


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • Yup. You are running SSMS 2008 R2 client tools but connecting to a SQL Server 2005 instance.

    So really we are back to the advice in my first post 🙂

  • Thanks. Now, I am certain I installed SQL Server 2008 R2 in full a few months ago. I may not have unistalled existing instances correctly, so how can I 'upgrade' my instance to 2008 now? I would rather not have multiple instances as they are a big headache in development!


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • A named instance is not that big a hassle - why do you think it is?

    If you are determined to have only a single instance, this is a dedicated dev box and there are no other complications the personally I would would flatten it, reimage and then reinstall. I prefer to install on a virgin box rather than start uninstalling and upgrading instances.

  • hallidayd (10/21/2010)


    A named instance is not that big a hassle - why do you think it is?

    If you are determined to have only a single instance, this is a dedicated dev box and there are no other complications the personally I would would flatten it, reimage and then reinstall. I prefer to install on a virgin box rather than start uninstalling and upgrading instances.

    I admit to being stumped by the high jargon; I'd be obliged if you could explain more clearly. Please!


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

  • I mean reinstall from the operating system upwards. I have just been stung too many times when I have installed then uninstalled then upgraded etc. etc.. I like to start from a blank slate where possible, which with a dev machine normally is.

    Have your IT guys taken images of the system so can rebuild your server from the OS up?

  • Yes, I know what you mean. I used to do it the same way till I found out that uninstall does not remove everything. It actually keeps logs of every install and uninstall. At one point I found I had reached 56!!!


    Regards,

    goodguy

    Experience is a bad teacher whose exams precede its lessons

Viewing 13 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic. Login to reply