StringBuilder sb = new StringBuilder();
sb.Append("INSERT INTO Threads(");//How can i modify that statement
sb.Append(" SELECT @Repuation, @WiningComment");
sb.Append(" FROM Users AS u");
sb.Append(" INNER JOIN Threads AS t ON t.UsersID=u.UsersID");
sb.Append(" WHERE t.ThreadsID=@ThreadID");
I have users table and threads table. I want to insert the @Reputation into the users table and @winingComment into the threads table!! How do i achieve that?
You will need to do 2 seperate
INSERTstatements as you can’t insert data into 2 tables simultaneously.