?
Solved

Sql Server Problem adding records

Posted on 2008-06-25
4
Medium Priority
?
293 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
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.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

719 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