Building a query to copy user security settings to another user I am trying to write a query to look at a current users security settings, and then copy those settings over to another user. My data is as follows:

 Logon_user  Logon_level   Form
 ABOND        1            COST
 ABOND        0            PRODUCTION
 ADOND        0            ACCOUNTING
 ATEMPLE      0            COST
 ATEMPLE      0            PRODUCTION
 ATEMPLE      0            ACCOUNTING


I would like to look at the settings for ABOND and copy the logon_level values to ATEMPLE.
You could try something like:

CREATE TABLE dbo.MyTable
(
    Logon_User VARCHAR(255)
    , Logon_Level INT
    , Form VARCHAR(255)
);

INSERT INTO dbo.MyTable VALUES 
('ABOND', 1, 'COST')
, ('ABOND', 0, 'PRODUCTION')
, ('ABOND', 0, 'ACCOUNTING')
, ('ATEMPLE', 0, 'COST')
, ('ATEMPLE', 0, 'PRODUCTION')
, ('ATEMPLE', 0, 'ACCOUNTING');

UPDATE MyTable
SET Logon_Level = T.Logon_Level
FROM MyTable 
    INNER JOIN MyTable T ON MyTable.Form = T.Form
WHERE MyTable.Form = T.Form 
    AND T.Logon_User = 'ABOND'
    AND MyTable.Logon_User = 'ATEMPLE';


SELECT *
FROM dbo.MyTable;