Products

Solutions

Resources

Partners

Community

About

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Modify AddUser Store ProcedureModify AddUser Store Procedure
Previous
 
Next
New Post
2/7/2006 3:51 PM
 

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

 
New Post
2/8/2006 2:08 AM
 

Hard to say without seeing your table definition, but I'm guessing your date formats are incorrect.  You can test this kind of SQL using Query Analyzer and get pretty good error messages.

If you really have to do something like this... I would highly recommend writing a trigger, rather than acutally modifying the built in queries... thats going to make upgrading much more painful.


Scott Willhite, Co-Founder DNN

"It is only with the heart that one can see rightly... what is essential is invisible to the eye. "
~ Antoine de Saint-Exupéry

 
New Post
2/11/2006 5:40 PM
 
Did some reading and worked out a trigger as suggested. GREAT IDEA! Thanks for the advice.
 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Administration ...Administration ...Modify AddUser Store ProcedureModify AddUser Store Procedure


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out