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.
Author |
Topic |
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-12-05 : 11:07:17
|
I have procedure which takes dates in the form of varchar fields, but when I pass the dates as I get an errorALTER procedure P_REALTYTAX (@DATE1 varchar(20), @DATE2 varchar(20))asEXEC dbo.[P_REALTYTAX] ('2007-12-05', '2007-12-05')EXEC dbo.[P_REALTYTAX] ('11/07/07', '11/07/06')I get the following errorServer: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near '2007'.ThanksSri |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-12-05 : 11:11:41
|
quote: Originally posted by scelamko I have procedure which takes dates in the form of varchar fields, but when I pass the dates as I get an errorALTER procedure P_REALTYTAX (@DATE1 varchar(20), @DATE2 varchar(20))asEXEC dbo.[P_REALTYTAX] '2007-12-05', '2007-12-05'EXEC dbo.[P_REALTYTAX] '11/07/07', '11/07/06'I get the following errorServer: Msg 170, Level 15, State 1, Line 1Line 1: Incorrect syntax near '2007'.ThanksSri
Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-12-05 : 11:12:44
|
What Harsh did (if you not already noticed) is to remove the paranthesises.Only UDF calls need them. SP calls do not. E 12°55'05.25"N 56°04'39.16" |
 |
|
scelamko
Constraint Violating Yak Guru
309 Posts |
Posted - 2007-12-05 : 11:46:49
|
Thanks Harsh and Peso that helps |
 |
|
|
|
|
|
|