title: How to copy values from a table to another table C# SQL
body: <p>l have a table named Students and it has StudentID which is primary key and another table is StdAccounts and it has StudentID as well.</p>
  
  <p>When l register someone l want program to copy StudentID(from Students) to StudentID(StdAccounts)
  l searched my problem on internet. Found something and tried to change. This is what l did and doesnt work </p>
  
  <pre><code>INSERT INTO (StdAccounts(StudentID), StudentPassword)
    select s.StudentID FROM Students s
    WHERE NOT EXISTS (SELECT StudentID FROM StdAccounts std
                      WHERE s.StudentID = std.StudentID) VALUES (@Password)
  </code></pre>