Solved

Sql Server Problem adding records

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server R2 Stored procedure performance 8 33
sql query 7 35
Data to display differently-SQL Server 4 19
Test a query 23 17
In this article I will describe the Copy Database Wizard 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.
JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

757 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

23 Experts available now in Live!

Get 1:1 Help Now