.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

SQL insert performance issue

Posted By:      Posted Date: October 27, 2010    Points: 0   Category :Sql Server

Hi all,

im taking a long period of time to do SQL insertion.

basically it takes ard 4ms for a record insert. Using query analyzer, i used a for loop and insert into a table 10000 times. the result 42 secs. I need to shorten this time taken as im doing some simulation work and real time analysis.

I am using scope_ident() to grab the primary key of a table and insert this primary key into another table. hence i don't think using bulk insert is possible.  

im using SQL Server 2000.

Pls help. thank you.

View Complete Post

More Related Resource Links

Performance Issue on SQL 2008 Box

Will SSRS and SSIS running on the same machine would hinders the perfromance of a database engine. 1. If so to what extent? 2. How do you tackle this kind of issue. 3. Is there a way you can separate these services from running on the same machine. The machine also has a OLTP database running on it.

XOML only workflow performance issue while creating

  In our application we are using XOML workflow and create workflow instance using workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters) where workflow and ruleReader are objects of XMLReader created using XmlReader.Create().For one of our business process automation we have developed XOML only workflow which has 35 states and 95 events. When we try creating an instance of the workflows it is taking more time and the time taken to create the instance is 3 min.Can any one suggest is there any other way to create workflow instance of XOML only workflows other than workflowRuntime.CreateWorkflow(workflow, ruleReader, workflowParameters)Your help is higly appreciated.Environment:    VS 2008    ASP.NET 3.5    WWF 3.5    XP  

Gridview Performance Issue

Hi All, I have one ASP.NET Application (VS.NET 2005). In that i have one scenario where i have to display 500 records per page (Not less than that bcoz this is client requirement to display 500 records per page) in the Gridview. This functionality is working fine but the application is becoming very slow. Can anybody tell me the solution for increasing performance in this case ???? VERY URGENT...PLZ REPLY SOON Thanks, Biswajit

Hiding radGrid Popup EditFrom after Udate/Insert Issue

Anyone work with radGrid that may be able to assist me in this I would greatly appreciate it.  I just cant seem to put my finger on why this is occurring, but...I have a radGrid that uses a template in the <editform> for insertion and update of grid records.  I am using the popup style instead of the inline (but this is occurring with all types).  When I click edit or new, the edit form displays perfectly.  When I make my changes or additions and submit them, the grid updates as it should with the new record, all changes/additions are made perfectly except one detail - the edit form will not go away!  It stays in edit mode and even shows the changes that were made no problem...  I tried to add the following to the Inserted and Updated event, but these do not seem to do a thing: Protected Sub grid_partners_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridInsertedEventArgs) Handles grid_partners.ItemInserted grid_partners.MasterTableView.IsItemInserted = False End Sub Protected Sub grid_partners_ItemUpdated(ByVal source As Object, ByVal e As Telerik.Web.UI.GridUpdatedEventArgs) Handles grid_partners.ItemUpdated grid_partners.MasterTableView.ClearEditItems() End SubAnyone know a better way, or I should say ANY WAY to do this?

.NET 4 Performance Issue String IndexOf



I have a performance issue with the new dot net 4.0 framework.

When i use the function String.IndexOf(string, stringcomparison.ordinalignorecase) my execution time is much higher than framework 3.5 (i had 30ms in a loop for 3.5 and 210ms in framework 4)

All other StringComparison mode are really good in framework 4.

Is there an explanation?

performance issue


i am having an issue in queying a table. This is something thats happening since the last 2 days. whenever i try to open a table (rightclick --> open table ) it errors  out saying the query time out period elapsed before the completion of the operation or server is not responding. But when i query select * from tablename..it is taking some time but is returning the results. The query time out period is set to 0(indefinite time out). we have never seen this kind of issue before. There are no open transactions either to assume that something is locking the system(dbcc opentran returns there are no open trans). Wondering why this is happening and also the performance of the system has gone down completely. Please help us in this issue. I checked the indexes for fragmentation and could see in some of them avg_fragementaton_percent like 60, 70, 80. i guess it is not good to have high such a value, so i ran dbcc reindex but still did not improve the performance. the avg_fragmentation was still the same.

Please advice. 

Issue with WCF performance


We have several WCF (3.5 hosted in IIS7) web services that are having some strange and inconsistent performance issues. In some environments they run fairly quickly. In others they time-out even if we significantly increase the timeout. We have tried all of the advice for performance tuning an IIS 7 hosted WCF service to no avail.

The svc log however shows some odd beheavior I am not sure how to interpret. I will get a message saying Opened System.ServiceModel.InstanceContext/..... The next message will say "A message was read". all good except it takes over six minutes sometimes. I do not follow these logs well enough to understand what could be causing this.

If anybody could provide any help or guidance, it would be greatly appreciated.

Best regards,


 Additional information: Just realized that the servers where we are having the large delays reading the message have Symantec "Data Endpoint Security" installed. Seems like it could be related. anybody have familiarity with this AV client and WCF?

Performance Issue.



I have a query which involves a table and a function. Table has got around 59 crores of records and the function returns 56k records. There is a inner join between with function being on the left side. This query takes around 2 minutes to execute. I wanna improve the performance to few seconds.

I made sure that the table has all required indexes but still was not able to improve the performance.

Please suggest what else i can do to improve performance.







Sql Server compact Edition Performance issue

I was  trying to insert a .wav file to sql server CE..The file is of size 1 Mb,but it takes a long time to perform the action (more than 1 min).Anybody have solution ? please help me..



I'm newbee in ASP.NET. I'm using Visual Studio to produce a webpage.

I would like to add values in a table, but I can't. Need your precious help.

I have some text boxes in a Page with a button and I want to put the values of the text boxes into a table. My code for the button is this:

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim connString As String = ConfigurationManager.ConnectionStrings("LoopGestDB").ConnectionString
        Dim cmd As Data.SqlClient.SqlCommand = Nothing

Performance Issue


we did a performance check on production and found that an object is missing from the Layout page which causes the below error frequently.

 When we check the log file we get the below error

1. SearchUpgradeGetKeywordPropertyBag keywordsPropertyBag is null

2. Cannot open file "Resources.en-US.resx" for reading.
(#3: Cannot open file "Resources.resx" for reading.)


Most of the time SearchUpgrade and Cannot open file error are followed by While Initializing navigation error.

And we receive a deadlock error in the IIS(ISAPI.dll) at the same time when we receive this error.

Read Uncommited (Bulk insert) and Performance


Hi all,

I have issues with Concurrency.

there has been times when updates happen on my fact table while some users read data from it at the same time, it takes a very long time and there is some blocking issues.

1.My inserts happen as Bulk inserts. I would like to know if I change my query to use NOLOCK will it still be blocked by the Bulk insert when i read? so does Bulk insert do an exclusive lock, so i cant read data?

2. changing my query to use NOLOCK is it benefical?

Please help me

vs 2010 performance issue


we have migrated our application from vs 2005 to 2010 we found that page loading time is increased 

any idea why this is happing or how to improve it 

Performance issue with GridView


Hi All,

             i am facing performance issue while using the datagrid in my project, i am writing my code here please correct me if i am writing something wrong.

i am using sql server 2000 in which i have a table containing around 600000 records and i can not put any indexing on this table as this is the staging table for me .

now To show these record on front end i am using gridview with Allowpaging = "True" now in the PageIndexChanged event i have to again hit the database and bind the grid which results very slows performance as just to change the page i have to read 600000 records again and again, i am giving some idea below what i am doing

Public Void BindgridView()


//do database connection

//fill the dataset through adapter

Gridview.datasource = dataset();



protected void GridView_PageIndexChanging(object sender, GridViewPageEventArgs e)
      GridView1.PageIndex = e.NewPageIndex;

Any idea how can i imrove the performance, Please help me out..



SQL XML Bulk Insert 3 tables format issue


I would like to ask for you help finding a problem in my XML schema.  I need to do a bulk insert into 3 tables that are linked.  I have an address, site and customer table. It is an SQL Server 2008 Database


The customer table links to its address in the address table.  The Address table contains no links to other tables and the site table contains a link to the customer and to the sites address.

From my understanding of this bulk insert procedure, I need to insert my address for my customer then my customer with a link to its address.  Then I want to insert my sites for my customer but they need their addresses too so I want to insert the site address and then the site with the key relationships to its address and customer row in those tables.

The xsd file is below that I have at the moment:

<?xml version="1.0" encoding="utf-8"

Updating multiple Indexes on a table - Performance issue



I have a performance issue when trying to update a table with multiple indexes. The table itself has about 280 million rows. The selection of the records is fast, about 160 ms, as it has a suitable non-clustered index. However the update itself takes over 10 minutes.

When I look at the excution plan, it shows the update to the clustered index as well 5 other non clustered index which are being affected by the statement. Unfortunately it doesn't show me how those indexes are being accessed. I suspect that the update statement is performing a full index scan against each of the non-clustered indexes in order to do the update.

So my question is this, if i add the key columns of the other non-clustered indexes as included columns on the index used to select the records for update will sqlserver use them to access the additional non-clustered indexes?

any advice greatly appreciated


Performance issue with select query



I have simple select query as below

SELECT DISTINCT BCEGPrsLinesCd, BCEGCmlLinesCd,CountyFedInfoPrcStdNbr

FROM TPSeleBCEGAddress WITH(nolock)




AND LTRIM(RTRIM(PrefixStreetDirCd))='E'






AND LTRIM(RTRIM(BCEGEffectiveYr))='1998'

Table TPSeleBCEGAddress has 64 Lakhs records in it and it takes around 22 Seconds to execute this query. Please let me know a way to improve performance of this select query.

Primary key defined on this table comprises of 16 columns.






ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend