Goto IN Procedure MS-SQL

/*
Writer : Han Yeong Min
Regdate : 2004-08-25
Description : Logon Statictics by Gender
*/


ALTER Procedure dbo.up_LogonStatictics_SPM_Get
@SelMode TinyINT = 0
, @DayStyleMode TinyINT = 0
, @SearchDate Varchar(10) = ''
AS

IF @SelMode = 1 Goto ByGender

IF @SelMode = 2 Goto ByAgeRate

ByGender:

IF @DayStyleMode = 1 Goto ByGender_Day
IF @DayStyleMode = 2 Goto ByGender_Week
IF @DayStyleMode = 3 Goto ByGender_Month
IF @DayStyleMode = 4 Goto ByGender_Year

Return
ByAgeRate:

IF @DayStyleMode = 1 Goto ByAgeRate_Day
IF @DayStyleMode = 2 Goto ByAgeRate_Week
IF @DayStyleMode = 3 Goto ByAgeRate_Month
IF @DayStyleMode = 4 Goto ByAgeRate_Year

Return

ByGender_Day:
Execute dbo.sp_Statictics_Logon_Sex_Daily_Get @SearchDate
Return
ByGender_Week:
Execute dbo.sp_Statictics_Logon_Sex_Weekend_Get @SearchDate
Return
ByGender_Month:
Execute sp_Statictics_Logon_Sex_monthly_Get @SearchDate
Return
ByGender_Year:
Select 'sex_year'
Return
ByAgeRate_Day:
Execute sp_Statictics_Logon_AgeRate_Daily_Get @SearchDate
Return
ByAgeRate_Week:
Execute sp_Statictics_Logon_AgeRate_WeekEnd_Get @SearchDate
Return
ByAgeRate_Month:
Execute sp_Statictics_Logon_AgeRate_Monthly_Get @SearchDate
Return
ByAgeRate_Year:
Select 'age_year'
Return

Go




-------------------- Result by procedure -----------------------
--By Sex And Daily
Execute up_LogonStatictics_SPM_Get 1, 1, '2004-08-11'
--By Sex And WeekDay
Execute up_LogonStatictics_SPM_Get 1, 2, '2004-08-11'
--By Sex And Month
Execute up_LogonStatictics_SPM_Get 1, 3, '2004-08-11'
--By Sex And Year
Execute up_LogonStatictics_SPM_Get 1, 4, '2004-08-11'
--By AgeRate And Daily
Execute up_LogonStatictics_SPM_Get 2, 1, '2004-08-11'
--By AgeRate And WeekDay
Execute up_LogonStatictics_SPM_Get 2, 2, '2004-08-11'
--By AgeRate And Month
Execute up_LogonStatictics_SPM_Get 2, 3, '2004-08-11'
--By AgeRate And Year
Execute up_LogonStatictics_SPM_Get 2, 4, '2004-08-11'