How to update a single record in a table based of foriegn key ID in another table? I am still very new to sql. I am having troubles updating one table. I am sending information from a web application into Microsoft SQL 2008 database. I have a table called EmployeePermissions that has employee ID and Permission ID. The Permission ID links this table to the Permissions table where different permissions are located and given a true or false value. If I am sending SQL the employee ID and the true or false values of the specific permissions, how do I update the Permissions table by sending the information through the EmployeePermissions table? Hopefully the diagram below can help explain a little better. Thanks!
OK, so I'm not going to comment on the table design as I assume that this is just part of the tables.

To do the update that you are looking for there's a couple of options.

You can get the Permission ID and put it into a variable, then use that against the permission table.

DECLARE @PermissionId INT

SELECT @PermissionId = PermissionId
from Employee
where EmployeeId = 2

UPDATE Permission
SET Read='T', Write='T', Delete='T'
where Permission = @PermissionId


Or you can do it all with a join in your update statement.

UPDATE p
SET Read='T', Write='T', Delete='T'
FROM Permission p
JOIN Employee e ON p.PermissionId = e.PermissionId
WHERE e.EmployeeId = 2


In either case you'll want to properly parameterize the query in your application layer to prevent against SQL Injection.