Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
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
?
348 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

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
One of the most important things in an application is the query performance. This article intends to give you good tips to improve the performance of your queries.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

610 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