Hey All,
I want to insert a record into a table when a new user is created. I've been playing with the AddUser stored procedure but cannot make it work as I want. I may be in the wrong procedure but I've created new users and watched the table data so I know that AddUser has something to do with it. The blue code below is from the default procedure. My code is in red. I cannot get this procedure to populate the members table. What am I doing wrong? Thanks.
begin
insert into Users (
Username,
FirstName,
LastName,
AffiliateId,
IsSuperUser,
Email
)
values (
@Username,
@FirstName,
@LastName,
@AffiliateId,
@IsSuperUser,
@Email
)
select @UserID = SCOPE_IDENTITY()
************** MY CODE ****************
begin
insert into members(
memberid,
fname,
beginDate,
memberDate,
inactivedate)
VALUES (
@UserID,
@Firstname,
'1-1-9999',
'1-2-9999',
'1-3-9999'
)
end
************** MY CODE ****************
end