Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to test a date value in a SP

Author  Topic 

viperbyte
Posting Yak Master

132 Posts

Posted - 2012-01-11 : 15:01:45
Hello everyone. I wrote a stored procedure that uses a variable of type date. I wanted to test the stored procedure in SQL Server Management Studio before testing it with the ASP.NET app. I right clicked on the name of the Stored Procedure in Management Studio and then clicked Execute Stored Procedure. Then I filled the value boxes with appropriate data. For the date field I typed 1/1/12. I get an error that says something about a syntax error near the "/". It has something to do with the date value I supplied. How am I supposed to enter this date value for the test?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-01-11 : 15:14:14
Execute the stored procedure in a new query window, like this:

EXEC sproc1 @var1 = '01/01/2012'

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

viperbyte
Posting Yak Master

132 Posts

Posted - 2012-01-11 : 15:50:00
Thank you Almighty one.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-01-11 : 15:51:02


Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -