Execute Stored Procedure with date variable

Posted on 2011-04-19
Last Modified: 2012-05-11
Hello Folks,

I have created a Stored Procedure in MS Management Studio in a MS SQL Server 2008. The SP required a input parameter called @InputDate.
The input date is defined as:

@InputDate as datetime = '1753-01-01 00:00:000'

When I right-click the SP and click Execute Stored Procedure Studio Management gives me:

 Screen shot from Mangament Studio
When I click OK it gives me the following error message:

Msg 8114, Level 16, State 5, Procedure CustomerWebServiceGetByDate, Line 0
Error converting data type nvarchar to datetime.

(1 row(s) affected)

So I know that I don't parse the correct value.
Can somebody please help me with the correct value to parse?

Question by:Madsing
    LVL 32

    Accepted Solution


    Input the date as '2010-12-31'

    Or use new query and execute as

    EXECUTE CustomerWebServiceGetByDate '2010-12-31'

    Author Comment

    Year, now it seems so obvious :-D
    Thanks a bunch!  

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
    Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor ( If you're interested in additional methods for monitoring bandwidt…

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now