Hey Countessa,
First, I wish to re-state I really would not do this from SQL, go through the Interface. Not only do you have to worry about if there are any current year transactions for the employees to remove the code from the employee, but you have to worry about previous year(s) transactions for the code that may have unpredicatable BAD effects if you just delete them. By going through the interface there is a lot of background checking that determines if it is ok to delete that code. By using SQL you are skipping all of those checks and balances.
Now with that being said. First setup a TEST system. Not a test company an entire test system. Separate SQL Server, separate client everything. And do lots of testing on removing these codes in test before doing anything in production. Include things like reprinting old reports for previous years, etc. Also, check into how Reconcile and Check Links work as you are talking about removing detail records that these utilities need, especially Reconcile.
Check out these Blog Posts that contain code on searching the entire database located here written by Jivtesh and this one here that I wrote myself. Note: As the scripts were written with two different ideas in mind I would actually suggest running both of them and cross referencing the results.
By using these scripts you can get a list of every table in the database that contains a specific value like one of your Payroll Codes. And then do as you wish.
However, I wish to point out (yes, once again).
The most I would do, if it were me, is to set the field "INACTIVE" to a value of "1" for the codes you want to get rid of in the following tables.
UPR00400 -- This is the list of pay codes for a specific employee
UPR00500 -- This is the list of Deductions for a specific employee
UPR00600 -- This is the list of Benefits for a specific employee
Once I had done that (notice that was update not delete) then I would go into the master setup for each of those codes using the Dynamics GP Interface and on the master setup screen for each code mark the code itself as inactive. Again this is just an update not a delete. Additionally, check any Class, Department, Positions, or other Setup items that contain a list of Payroll Codes defaults and remove them from the lists.
At this point when you are assigning Payroll Codes to an Employee, if you use the Active codes only view then you should not even see these codes at all. And just leave the codes in your database as old deactive codes. I woud really never actually delete them.
Also, the tables I memtioned are only the Payroll Tables, it does not take into accout the Human Resources(HR) side of things at all. If you are using HR then there are a lot other tables that get involved.
Let me know if this helps and feel free to contact me if you wish.