L
Leon
I have a situation in which I need two stored procedures that do basically
the same thing,
but takes in a different parameter value and return less of the same data. I
wonder is it best to
do two different stored procedures or just one to accomplish my goal?
The first sp take in the @emailaddress parameter value and selects the
following values from two different table:
Username, Password, FirstName, LastName
for completeness here the full second sp....
CREATE PROCEDURE GetStudentDetail
@AccountID INT
AS
SELECT A.Username, A.Password, A.SecretQuestion, A.SecretAnswer,
A.RoleID, A.Active, S.FirstName, S.LastName,
S.BirthMonth, S.BirthDay, S.BirthYear, S.Gender, S.SchoolState,
S.SchoolName, S.Classification, S.Major, S.EmailAddress
FROM Account A INNER JOIN Student S ON A.AccountID = S.AccountID
WHERE A. AccountID = @AccountID
GO
Can I accomplish my goal in a better more efficient way or do I need two
stored procedures?
Thanks!
the same thing,
but takes in a different parameter value and return less of the same data. I
wonder is it best to
do two different stored procedures or just one to accomplish my goal?
The first sp take in the @emailaddress parameter value and selects the
following values from two different table:
Username, Password, FirstName, LastName
for completeness here the full second sp....
CREATE PROCEDURE GetStudentDetail
@AccountID INT
AS
SELECT A.Username, A.Password, A.SecretQuestion, A.SecretAnswer,
A.RoleID, A.Active, S.FirstName, S.LastName,
S.BirthMonth, S.BirthDay, S.BirthYear, S.Gender, S.SchoolState,
S.SchoolName, S.Classification, S.Major, S.EmailAddress
FROM Account A INNER JOIN Student S ON A.AccountID = S.AccountID
WHERE A. AccountID = @AccountID
GO
Can I accomplish my goal in a better more efficient way or do I need two
stored procedures?
Thanks!