?
Solved

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

Posted on 2006-06-21
3
Medium Priority
?
342 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
[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
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 80 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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Viewers will learn how the fundamental information of how to create a table.
Suggested Courses

752 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