October 10, 2007 at 6:13 am
New to T-SQL.
I code this:
If @MonthLit = 'January' Set @Period = 1
Else If @MonthLit = 'February' Set @Period = 2
Else If @MonthLit = 'March' Set @Period = 3
Else If @MonthLit = 'April' Set @Period = 4
Else If @MonthLit = 'May' Set @Period = 5
Else If @MonthLit = 'June' Set @Period = 6
Else If @MonthLit = 'July' Set @Period = 7
Else If @MonthLit = 'August' Set @Period = 8
Else If @MonthLit = 'September' Set @Period = 9
Else If @MonthLit = 'October' Set @Period = 10
Else If @MonthLit = 'November' Set @Period = 11
Else If @MonthLit = 'December' Set @Period = 12
Else RaiseError('Invalid month', 10 , 1)
And get this error message:
Msg 102, Level 15, State 1, Procedure cspGE2005, Line 23
Incorrect syntax near 'RaiseError'.
Can someone show me how to properly code this structure?
Thanks.
October 10, 2007 at 6:22 am
It should be Raiserror (with a single 'e')
October 10, 2007 at 6:33 am
Well Junkie...I feel real stupid now for asking.
Thanks!
October 10, 2007 at 6:37 am
Yes' it's a pitty there's no F7 in SMS...;)
______________________________________________________________________
Personal Motto: Why push the envelope when you can just open it?
If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.
Jason L. SelburgViewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply