Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sql Server Problem adding records

Posted on 2008-06-25
4
Medium Priority
?
298 Views
Last Modified: 2012-06-27
I am new to sql server.  I was adding records to tables and was disableing the indentity feature so that it would us the the keys that were already created.  I did something and now I get the error message about usage stats.  Now anytime I try to add or change a record, I get the error message.  Did I enable statistics somehow without adding the table to handle it?  How do I get rid of this?
Thanks
0
Comment
Question by:VonGeist
  • 2
  • 2
4 Comments
 
LVL 3

Expert Comment

by:GHCS_Mark
ID: 21870897
Sounds like you have.  If you are wanting to insert values into a table with an IDENTITY column, you should look at SET IDENTITY_INSERT <tablename> ON.  This will allow you to specify your own identity values when using an INSERT statement.
0
 

Author Comment

by:VonGeist
ID: 21873670
I dont have any problem turning the identity on or off.  The problem is that now anything I do with any of the tables causes the "usagestats" error.  What are usage stats and how do I turn them off? (if that is what I need to do).
Thanks
0
 
LVL 3

Accepted Solution

by:
GHCS_Mark earned 2000 total points
ID: 21874106
OK, take a look at http://msdn.microsoft.com/en-us/library/ms175075.aspx.  It does warn that you can end up with issues if you remove statistics incorrectly, so maybe that is what happened in a round about way.

From what I know, statistics are always on as it is what SQL server uses to determine the best execution plan, etc.  
0
 

Author Comment

by:VonGeist
ID: 21874384
Sorry, I may be looking at this the wrong way.  Everytime I do anything with the tables, its looking for and enry in the sysdatabase called "usagestats",  maybe all I need to do is create that.  Does that seem logical and how would I create this since everytime I do anything I get the error.  sounds like a catch 22
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question