I'm not a professional programmer but an enthusiast who needs help. Here is my challenge:
I have a table full of data for our employees.
Currently, any of our employees can go to the "Update" web page on our web site and type in his new last name over the previous one that is displayed in a textbox and click submit, his last name will be updated in the database. However, my supervisor wants to keep the employees' previous last name in the same table as the new last name. Her idea is when an employee types in his new last name in the textbox, it will trigger the database to store his previous last name in a column called "Alias" and then update his new last name in the "LastName" column. How do I proceed with that?
Here is the structure of the table:
PeopleID (int)
JobIDNum (int)
EmployeeIDNum (varchar(25))
Email (varchar(100))
Password (varchar(50))
LastName (varchar(50))
FirstName (varchar(25))
Deleted (char(1))
Alias (varchar(50))
I appreciate any assistance and/or advice I can get.
Try this update statement:
Where the
@LastName
is a parameter with new value,@PeopleID
is a id of corresponding people.Suggest a stored procedure that you can call from ASP.
Call this stored proc in your ASP code like this: