Declare @wno nchar(50),@type integer,@proficiency nchar(20)
Declare cur cursor
for select distinct [Employee Number],[Language Type],Proficiency from [Speciality$]
open cur
-- on error resume next
fetch next from cur into @wno,@type,@proficiency
begin tran
while @@FETCH_STATUS=0
begin
Insert Into bqp..language (wno , type , proficiency) Values (@wno , @type , @proficiency)
FETCH NEXT FROM cur into @wno,@type,@proficiency
print @@error
print @@rowcount
IF @@error != 0 OR @@rowcount != 1
begin
print @@error
rollback tran
--close cur
--DEALLOCATE curselect *
--return
end
end