Solved

Turning the AutoNumber property Off in SQL Server

Posted on 2013-06-22
2
607 Views
Last Modified: 2013-06-23
I need to insert predefined autonumbers from another table into a new table. Is there a way to turn the AutoNumber property off in the new table, insert the records, then turn the property back on?
0
Comment
Question by:SpaceCoastLife
[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
2 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39268374
SET IDENTITY_INSERT OFF

-- Do your inserting into a tale with an identity column here

SET IDENTITY_INSERT ON

http://msdn.microsoft.com/en-us/library/aa259221(v=sql.80).aspx
0
 

Author Closing Comment

by:SpaceCoastLife
ID: 39269690
Thanks for the help
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
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.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

635 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