Delete duplicate records from a table

Delete duplicate records from a table (SQL) having a unique id (Primary key) or auto incremented id.

DELETE FROM Emp_Details WHERE EmpID in(SELECT EmpID FROM Emp_Details GROUP BY EmpId HAVING  COUNT(*) >1)



Where Emp_Details is a table and EmpID is A auto incremented  Column 

Why we can't execute a stored procedure from a User Defined function(UDF)

Functions cannot "touch" any database but read them only. Stored procedures can do anything and everything with databases. You ...