T-SQL : script to remove duplicates from a table with no primary key

BEGIN
Declare @guid UniqueIdentifier
DECLARE CursorQuery CURSOR FOR
--Select all the records with duplicate records (assuming column 'testguid' has to be unique)
select testguid from TestTable group by guid having count(*)>1
OPEN CursorQuery
FETCH NEXT FROM CursorQuery
INTO @guid
WHILE @@FETCH_STATUS = 0
BEGIN
DELETE TOP(1) FROM dbo.TestTable WHERE guid = @guid
FETCH NEXT FROM CursorQuery
INTO @guid
END
CLOSE CursorQuery
END
GO

The views and content on my site are my own and do not represent those of my employer. All content is provided "AS-IS" with no warranties and confers no rights.