Stored Procedure to Insert Two Tables with Relationship?

前端 未结 3 457
日久生厌
日久生厌 2021-01-19 14:24

I was trying to insert a new row into two tables which has a relationship between. I wrote the stored procedure as follows.

ALTER PROCEDURE InsertUserProfile         


        
3条回答
  •  死守一世寂寞
    2021-01-19 15:00

    Create Table tbl_user_login
    (
    **ID INT Identity(1,1),**
    UserID varchar10,
    Pass varchar50 ,
    Enabled int,
    Permission int ,
    Rank int
    );
    

    Make ID column as Identity(1,1) that will be auto incremented column and that will solve your problem. Make it in both tables.

提交回复
热议问题