SQL Server 2005 provides a very easy way to remove duplicate values through the use of a Common Table Expression (CTE). The script below creates a temp table named #PendingAccounts. Notice that I will check in the tempdb to see if the table already exists...