Solved

Sql Server Problem adding records

Posted on 2008-06-25
4
263 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 500 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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.

896 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now