Slow data insert on Sql

Vebyunsobby

New Member
I'm just trying to import data to database (Sql) from a dataset, but its a bit slower when I try to import 70000 rows. Am I doing something wrong or missing?Could please give me some advice how can I do it better?Here is my asp.net code:\[code\]ArtiDB entity = new ArtiDB();int grid = 50;foreach (string item_kisiler in kisiler){ if (item_kisiler == "") continue; if (Tools.isNumber(item_kisiler) == false) continue; else { string gsm1 = item_kisiler; if (gsm1.Length > 10) gsm1 = gsm1.Substring(1, 10); entity.veriaktar(gsm1, gg, grid); } }\[/code\]This is my store prosedure:\[code\]alter proc veriaktar( @gsm1 nvarchar(50)=null, @userid uniqueidentifier,@grupid int = 0)as beginDeclare @AltMusID int if not exists (select * from tbl_AltMusteriler with (updlock, rowlock, holdlock) where Gsm1=@gsm1 and UserId=@userid) begin insert into tbl_AltMusteriler (Gsm1,UserId) values (@gsm1,@userid) Set @AltMusID = scope_identity() end else begin Set @AltMusID = (select AltMusteriID from tbl_AltMusteriler with (updlock, rowlock, holdlock) where Gsm1=@gsm1 and UserId=@userid) end if (@grupid != 0) begin if not exists (select * from tbl_KisiGrup with (updlock, rowlock, holdlock) where GrupID=@grupid and AltMusteriID=@AltMusID) begin insert into tbl_KisiGrup values(@grupid,@AltMusID) end end end go\[/code\]
 
Back
Top