I have a storedProcedure in SQL-Server that I am using to delete duplicates from one of the tables.
This storedprocedure makes use of a cursor.
I tried to create the same storedprocedure in microsoft access by
just replacing the 'CREATE PROCEDURE' with 'CREATE PROC' but it didn't
seem to work.
Can anyone provide some workaround?
Here is the SQL- storedprocedure:-
ALTER PROCEDURE [dbo].[csp_loginfo_duplicates] AS BEGIN
SET NOCOUNT ON;
declare @minrowid bigint declare @empid nvarchar(15) declare @dtpunched datetime declare @count tinyint
declare curDuplicate cursor for select empid,dtpunched,count(*),min(row_id) from loginfo group by empid,dtpunched having count(*)>1
open curDuplicate
fetch next from curduplicate into @empid,@dtpunched,@count,@minrowid
while (@@fetch_status=0) begin delete from loginfo where empid=@empid and dtpunched=@dtpunched and row_id<>@minrowid fetch next from curduplicate into @empid,@dtpunched,@count,@minrowid
end
close curDuplicate deallocate curDuplicate END