How to write update query to update two tables with SQL Data Source?

前端 未结 3 957
梦谈多话
梦谈多话 2020-12-21 06:25

Is it possible to update two tables using SQL Data Source and ASP.NET Grid View? I have the following SQL Query for the Select statement.

SELECT 
   tbl_user         


        
3条回答
  •  长情又很酷
    2020-12-21 06:50

    CREATE PROC UpdateUser
    (
        @ID int
        ,@Pass varchar(15)
        ,@Email varchar(75)
       ) AS
    BEGIN
    
    Update
       tbl_user_login
    Set
       Pass = @Pass
    Where
       ID = @ID
    
    Update
      tbl_user_profile
    Set
      Email1 = @Email
    Where
      ID = @ID
    
    END
    

    You can write multiple sql commands into a single sproc as I have above. Expand updates as needed. Deletes work the same way...

提交回复
热议问题