You need to use If/Else If structure, like this:
If @Type = 1
Begin
INSERT INTO dbo.Credit (
CompanyName,
PhoneNumber,
City,
State
) VALUES (
@CompanyName,
@PhoneNumber,
@City,
@State)
End
Else If @Type = 2
Begin
INSERT INTO dbo.Debit (
CompanyName,
PhoneNumber,
City,
State
) VALUES (
@CompanyName,
@PhoneNumber,
@City,
@State)
End
Else If @Type = 3
Begin
--ETC
END
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…