Important alert: (current site time 7/15/2013 7:56:21 PM EDT)
 

article

HELP SQL SERVER2000

Email
Submitted on: 5/2/2005 1:57:50 PM
By: Assersoft  
Level: Advanced
User Rating: Unrated
Compatibility: SQL Server 2000
Views: 6685
 
     HELP IN SQL SERVER 2000. I'M FACING PROBLEM IN SQL SERVER 2000. CAN ANYBODE HELP ME.

 
 
Terms of Agreement:   
By using this article, you agree to the following terms...   
  1. You may use this article in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this article (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this article from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the article or article's description.
				PROBLEM IS: 
I HAVE A TABLE CONTAINING ABOUT 40,000 RECORDS IN SQL2000 DATABASE. THE SIZE OF DATABASE IS ABOUT 40MB. WHEN I ADD NEW RECORD IN THE TABEL AND ISSUE FOLLOWING COMMAND TO SELECT THE IDENTITY OF EFFECTED RECORD IT TAKES A LOT OF TIME (ABOUT 6-7 SECOND) TO RETURN.
SQL STATEMENT IS
 SELECT @@IDENTITY FROM INVOICES 
PLZ HELP ME HOW CAN I REDUCE THIS DELAY.


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

5/2/2005 3:25:20 PMJoey Filichia

Use the following to narrow down your searches...
print IDENT_CURRENT('Invoices')
(If this comment was disrespectful, please report it.)

 
5/3/2005 3:55:44 AM

You may want to implement/use indexes by creating a particular indexes for a certain search/select criteria. In that way your search would not be doing a sequential search from 1 to 40000+th element of your table.
(If this comment was disrespectful, please report it.)

 
5/3/2005 9:07:50 AMChristina McEntire

Is your identity column also your clustered index? If you are using a different column for your clustered index, then SQL Server may be doing some "moving things around" to place the new record in the correct location per the clustered index, rather than just appending it onto the end. Also, if you have a ton of indexes on the table, that will also slow things down on an insert.
(If this comment was disrespectful, please report it.)

 
5/4/2005 6:05:26 AMdsoftnet

send or check execution graph, it will help.
(If this comment was disrespectful, please report it.)

 
5/5/2005 2:13:24 PM

Thanks Joey Filichia
IDENT_CURRENT('Invoices')
solved my problem. Thanks for your help
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)
 

To post feedback, first please login.