T-SQL: Find Duplicates Without Using JOIN

Filed under: SQL Server — Written by Chrissy on Thursday, May 15th, 2008 @ 12:34 pm

I'd forgotten about this lil trick.

select eUserName from eAttribute GROUP BY eUserName  HAVING COUNT( eUserName) > 1

SQL Server: Change the Owner of All Tables to "dbo"

Filed under: SQL Server — Written by Chrissy on Wednesday, May 7th, 2008 @ 6:32 pm

Reference for me. Reference for you.

sp_MSforeachtable @command1="EXEC sp_changeobjectowner '?','dbo'"