Solved

Cannot insert explicit value for identity column in table 'websites' when IDENTITY_INSERT is set to OFF.

Posted on 2006-06-21
3
320 Views
Last Modified: 2008-02-01
Hi

I try to do this

"INSERT INTO websites (website, uid, currentlymonitoring) values ('http://www.a.com', 1, '1')"

and uid is an Identity.

Is there a way to force it to insert into an Identity?

Thanks
0
Comment
Question by:boofulls
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 20 total points
ID: 16951049
Hi boofulls,

Set Identity_Insert Websites On
INSERT INTO websites (website, uid, currentlymonitoring) values ('http://www.a.com', 1, '1')
Set Identity_Insert Websites Off

Tim Cottee
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

773 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