How to insert in a table with Primary key and foreign key

  • I have one table "users" with "userid" as primary key and "createdBy" as foreign key from same table that mean

    "admin" which is in users table can create other normal users those are from same table "users" as "createdBy" of normal user

    here the problem is that when I am giving Application to Client with blank database how can one (admin) can create other user (initially his username & password is stored in App.Config file in .NET with "userid" 0 which is not in database will give error while creating other normal users) or how can admin add his own record in database with his own "userid" as "createdBy" field

    What to do?

    Thank you

    Sandeep Gupta

  • This is an application problem. You probably need to manually insert the admin record into both tables from EM (Enterprise Manager) or QA (Query analyzer)

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply