Solved

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

Posted on 2006-06-21
3
299 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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduced in Microsoft SQL Server 2005, the Copy Database Wizard (http://msdn.microsoft.com/en-us/library/ms188664.aspx) is useful in copying databases and associated objects between SQL instances; therefore, it is a good migration and upgrade tool…
I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
Viewers will learn how the fundamental information of how to create a table.
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

763 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

9 Experts available now in Live!

Get 1:1 Help Now