i’ve stored procedure person’s last name , insert under alias after updated last name on form. boss wants keep previous last names whenever person changes name each time. i’ve following data in sql table.
+----------------+---------------+----------------+------------------+ peopleid firstname lastname alias +-----------------+--------------+----------------+------------------+ 002112 judy smith hall
let’s say, judy changes last name again kingsley. possible grab previous last name smith , insert behind hall under alias? i’m thinking maybe table have no idea how.
+----------------+---------------+----------------+------------------+ peopleid firstname lastname alias +-----------------+--------------+----------------+------------------+ 002112 judy kingsley hall, smith
i suggest hold current value in table , create history table hold previous last name. :
create table last_name_history ( peopleid char(6), from_date datetime, to_date datetime, alias char(25) )
Comments
Post a Comment