Finding duplicate rows in SQL Server

select u.UserFirstname, u.UserLastname, u.UserID

from tblUsers u

inner join (

    SELECT UserFirstname, UserLastname, COUNT(*) AS recordCount

    FROM tblUsers

    GROUP BY UserFirstname, UserLastname

    HAVING COUNT(*) > 1

) u2 on u.UserFirstname = u2.UserFirstname AND u.UserLastname = u2.UserLastname

MSSQL Tables of DB or Fields of Tables

For Fields

SELECT * FROM yourDBName.INFORMATION_SCHEMA.COLUMNS

WHERE TABLE_NAME = N'yourTableName'


For Tables

SELECT * FROM yourDBName.INFORMATION_SCHEMA.TABLES