<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; Fix : Error 8101 An explicit value for the identity column in table can only be specified when a column list is used and IDENTITY_INSERT is ON</title>
	<atom:link href="http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/</link>
	<description>Personal Notes of Pinal Dave</description>
	<lastBuildDate>Thu, 09 Feb 2012 19:36:10 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Steve</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-223083</link>
		<dc:creator><![CDATA[Steve]]></dc:creator>
		<pubDate>Wed, 21 Dec 2011 19:25:48 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-223083</guid>
		<description><![CDATA[Thanks for the help, Tom.  This was exactly what I needed!]]></description>
		<content:encoded><![CDATA[<p>Thanks for the help, Tom.  This was exactly what I needed!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Grateful</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-132648</link>
		<dc:creator><![CDATA[Grateful]]></dc:creator>
		<pubDate>Tue, 03 May 2011 09:45:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-132648</guid>
		<description><![CDATA[GENIUS! This has been driving me mad for ages.]]></description>
		<content:encoded><![CDATA[<p>GENIUS! This has been driving me mad for ages.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Freeboot</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-110009</link>
		<dc:creator><![CDATA[Freeboot]]></dc:creator>
		<pubDate>Sat, 08 Jan 2011 17:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-110009</guid>
		<description><![CDATA[A simple way is to identify all the columns that have the &quot;Allow Duplicates&quot; attribute set to No. This will include the primary indices (e.g. the &quot;ID&quot; column which Access usually creates automatically.)

You then have one of two choices:
1. Turn the &quot;Allow Duplicates&quot; to Yes.
               OR
2. Delete the column.

Then 
3. Run the Bulk Import.
4. If you&#039;ve selected 2 above, then decide whether you need an index column, and create a new one.

I&#039;ve done 2 and it works. Do it especially if Access has created an index automatically for you - the content of such indices is usually unrelated to the data (any old unique values will do) so you can just build it in the end, as in 4.]]></description>
		<content:encoded><![CDATA[<p>A simple way is to identify all the columns that have the &#8220;Allow Duplicates&#8221; attribute set to No. This will include the primary indices (e.g. the &#8220;ID&#8221; column which Access usually creates automatically.)</p>
<p>You then have one of two choices:<br />
1. Turn the &#8220;Allow Duplicates&#8221; to Yes.<br />
               OR<br />
2. Delete the column.</p>
<p>Then<br />
3. Run the Bulk Import.<br />
4. If you&#8217;ve selected 2 above, then decide whether you need an index column, and create a new one.</p>
<p>I&#8217;ve done 2 and it works. Do it especially if Access has created an index automatically for you &#8211; the content of such indices is usually unrelated to the data (any old unique values will do) so you can just build it in the end, as in 4.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehboob Ali Yousafzai</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-91862</link>
		<dc:creator><![CDATA[Mehboob Ali Yousafzai]]></dc:creator>
		<pubDate>Fri, 08 Oct 2010 20:41:10 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-91862</guid>
		<description><![CDATA[Thnx alot !!!]]></description>
		<content:encoded><![CDATA[<p>Thnx alot !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michelle</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-77425</link>
		<dc:creator><![CDATA[Michelle]]></dc:creator>
		<pubDate>Wed, 23 Jun 2010 13:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-77425</guid>
		<description><![CDATA[Try specifying the columns names]]></description>
		<content:encoded><![CDATA[<p>Try specifying the columns names</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave S</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-72926</link>
		<dc:creator><![CDATA[Dave S]]></dc:creator>
		<pubDate>Mon, 24 May 2010 19:43:49 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-72926</guid>
		<description><![CDATA[thank you, Phil.  Love that coalesce trick!

and thank you, Pinal Dave!]]></description>
		<content:encoded><![CDATA[<p>thank you, Phil.  Love that coalesce trick!</p>
<p>and thank you, Pinal Dave!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kéké</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-68077</link>
		<dc:creator><![CDATA[kéké]]></dc:creator>
		<pubDate>Fri, 30 Apr 2010 14:55:23 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-68077</guid>
		<description><![CDATA[Hi ! In SQL SERVER 

SET IDENTITY_INSERT ON/ OFF

doesn&#039;t resolved my problem.

The only way to solve the problem was to specify the column list, ie :
INSERT INTO tbl (idcol1,col2) VALUES ( value1,value2)

Cheers !]]></description>
		<content:encoded><![CDATA[<p>Hi ! In SQL SERVER </p>
<p>SET IDENTITY_INSERT ON/ OFF</p>
<p>doesn&#8217;t resolved my problem.</p>
<p>The only way to solve the problem was to specify the column list, ie :<br />
INSERT INTO tbl (idcol1,col2) VALUES ( value1,value2)</p>
<p>Cheers !</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eliza Sahoo</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-63950</link>
		<dc:creator><![CDATA[Eliza Sahoo]]></dc:creator>
		<pubDate>Mon, 29 Mar 2010 12:19:53 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-63950</guid>
		<description><![CDATA[Lets have an Employee table in which some employee records are saved with the unique identity numbers for each employee. Now, suppose some records were deleted from the Employee table due to some reasons and now I want all the deleted records from Employee table,which may not be possible now as records are deleted from the table,but we can get the list of Unique Identity records deleted from Employee table by using query.

To demonstrate this first of all we have to create an Employee Table with some records inserted to it.Then we can delete some selected records from the Employee table to verify the output.

http://www.mindfiresolutions.com/How-to-get-the-Deleted-Identity-Numbers-in-SQL-Server-2005-799.php]]></description>
		<content:encoded><![CDATA[<p>Lets have an Employee table in which some employee records are saved with the unique identity numbers for each employee. Now, suppose some records were deleted from the Employee table due to some reasons and now I want all the deleted records from Employee table,which may not be possible now as records are deleted from the table,but we can get the list of Unique Identity records deleted from Employee table by using query.</p>
<p>To demonstrate this first of all we have to create an Employee Table with some records inserted to it.Then we can delete some selected records from the Employee table to verify the output.</p>
<p><a href="http://www.mindfiresolutions.com/How-to-get-the-Deleted-Identity-Numbers-in-SQL-Server-2005-799.php" rel="nofollow">http://www.mindfiresolutions.com/How-to-get-the-Deleted-Identity-Numbers-in-SQL-Server-2005-799.php</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Arvind</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-62536</link>
		<dc:creator><![CDATA[Arvind]]></dc:creator>
		<pubDate>Tue, 09 Mar 2010 17:47:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-62536</guid>
		<description><![CDATA[For the SQL statement, you also have to specify the column list. For eg.
INSERT INTO tbl (idcol1,col2) VALUES ( value1,value2)
instead of 
INSERT INTO tbl VALUES ( value1,value2)]]></description>
		<content:encoded><![CDATA[<p>For the SQL statement, you also have to specify the column list. For eg.<br />
INSERT INTO tbl (idcol1,col2) VALUES ( value1,value2)<br />
instead of<br />
INSERT INTO tbl VALUES ( value1,value2)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vibha</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-59486</link>
		<dc:creator><![CDATA[vibha]]></dc:creator>
		<pubDate>Fri, 08 Jan 2010 18:28:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-59486</guid>
		<description><![CDATA[Thanks a ton. that really worked]]></description>
		<content:encoded><![CDATA[<p>Thanks a ton. that really worked</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GiKw</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-58922</link>
		<dc:creator><![CDATA[GiKw]]></dc:creator>
		<pubDate>Tue, 22 Dec 2009 19:40:57 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-58922</guid>
		<description><![CDATA[it works for me]]></description>
		<content:encoded><![CDATA[<p>it works for me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: d</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-53782</link>
		<dc:creator><![CDATA[d]]></dc:creator>
		<pubDate>Fri, 17 Jul 2009 05:28:18 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-53782</guid>
		<description><![CDATA[SET IDENTITY_INSERT iRSA.CONFIGVAL ON]]></description>
		<content:encoded><![CDATA[<p>SET IDENTITY_INSERT iRSA.CONFIGVAL ON</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: PATCREL</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-52545</link>
		<dc:creator><![CDATA[PATCREL]]></dc:creator>
		<pubDate>Fri, 29 May 2009 18:07:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-52545</guid>
		<description><![CDATA[SET IDENTITY_INSERT  ON

insert into iRSA.CONFIGVAL
Select *  from [RIC-NT88].acptImageRIght.iRSA.CONFIGVAL

SET IDENTITY_INSERT  OFF

DID NOT WORK FOR ME,,,, THE ONLY THING THAT DID WAS THE FOLLOWING :

GO TO SQL SERVER MANGEMENT STUDIO.
RIGHT CLICK ON TABLE IN QUESTION


-- GO TO DESIGN VIEW AND TOGGLE (IS IDENTITY) TO &#039;NO&#039;(UNDER IDENTITY SPECIFICATION)

RUN SQL STATEMENT, GO TO DESIGN VIEW AGAIN ,TOGGLE BACK

ANYONE KNOW WHY THE SET STATEMENT DID NOT WORK?]]></description>
		<content:encoded><![CDATA[<p>SET IDENTITY_INSERT  ON</p>
<p>insert into iRSA.CONFIGVAL<br />
Select *  from [RIC-NT88].acptImageRIght.iRSA.CONFIGVAL</p>
<p>SET IDENTITY_INSERT  OFF</p>
<p>DID NOT WORK FOR ME,,,, THE ONLY THING THAT DID WAS THE FOLLOWING :</p>
<p>GO TO SQL SERVER MANGEMENT STUDIO.<br />
RIGHT CLICK ON TABLE IN QUESTION</p>
<p>&#8211; GO TO DESIGN VIEW AND TOGGLE (IS IDENTITY) TO &#8216;NO&#8217;(UNDER IDENTITY SPECIFICATION)</p>
<p>RUN SQL STATEMENT, GO TO DESIGN VIEW AGAIN ,TOGGLE BACK</p>
<p>ANYONE KNOW WHY THE SET STATEMENT DID NOT WORK?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sudeep</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-47918</link>
		<dc:creator><![CDATA[Sudeep]]></dc:creator>
		<pubDate>Tue, 03 Mar 2009 05:26:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-47918</guid>
		<description><![CDATA[Hi All,

Thanks for all those valuable suggestions, it worked for me !!!]]></description>
		<content:encoded><![CDATA[<p>Hi All,</p>
<p>Thanks for all those valuable suggestions, it worked for me !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: initonReItleGut</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-45147</link>
		<dc:creator><![CDATA[initonReItleGut]]></dc:creator>
		<pubDate>Mon, 29 Dec 2008 06:12:55 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-45147</guid>
		<description><![CDATA[hi admin and people nice forum indeed. how&#039;s life? You are great!]]></description>
		<content:encoded><![CDATA[<p>hi admin and people nice forum indeed. how&#8217;s life? You are great!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kaye</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-43941</link>
		<dc:creator><![CDATA[Kaye]]></dc:creator>
		<pubDate>Tue, 28 Oct 2008 02:29:31 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-43941</guid>
		<description><![CDATA[I&#039;ve inserted numerous times in the past to tables that had identity column but I didn&#039;t use column name list. 

Stumped myself until I removed the order by at the end of my select statement.   Then SQL assigns the identity number and I do NOT have to provide column list.]]></description>
		<content:encoded><![CDATA[<p>I&#8217;ve inserted numerous times in the past to tables that had identity column but I didn&#8217;t use column name list. </p>
<p>Stumped myself until I removed the order by at the end of my select statement.   Then SQL assigns the identity number and I do NOT have to provide column list.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: madhav</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-40262</link>
		<dc:creator><![CDATA[madhav]]></dc:creator>
		<pubDate>Tue, 15 Jul 2008 12:20:46 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-40262</guid>
		<description><![CDATA[Hi dave ,

i had a problem with importing database , i have gone through your blog but i didn&#039;t got a suitable solution , so plz go through this and help me in settings things right.

i am using sqlbulkcopy to import data from db2 to sql server 2005.

here my destination table in sql has a coloumn(some id coloumn) with identity specification

so when i import the data it defaultly takes the id and i am loosing the actual id&#039;s (the id &#039;s  in db2 )

i tried running a sql command  with (&quot;set identity_insert tablename on &quot;) before loading and again i reset it to &quot;off&quot; after loading (i.e; after writing to server with bulkcopy object) but for no use .

still i can&#039;t get the original ids  (from db2) --- i am loosing the data .

i am in a bottle neck situation , so plz kindly suggest me a solution ASAP.]]></description>
		<content:encoded><![CDATA[<p>Hi dave ,</p>
<p>i had a problem with importing database , i have gone through your blog but i didn&#8217;t got a suitable solution , so plz go through this and help me in settings things right.</p>
<p>i am using sqlbulkcopy to import data from db2 to sql server 2005.</p>
<p>here my destination table in sql has a coloumn(some id coloumn) with identity specification</p>
<p>so when i import the data it defaultly takes the id and i am loosing the actual id&#8217;s (the id &#8216;s  in db2 )</p>
<p>i tried running a sql command  with (&#8220;set identity_insert tablename on &#8220;) before loading and again i reset it to &#8220;off&#8221; after loading (i.e; after writing to server with bulkcopy object) but for no use .</p>
<p>still i can&#8217;t get the original ids  (from db2) &#8212; i am loosing the data .</p>
<p>i am in a bottle neck situation , so plz kindly suggest me a solution ASAP.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: am</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-39847</link>
		<dc:creator><![CDATA[am]]></dc:creator>
		<pubDate>Mon, 07 Jul 2008 07:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-39847</guid>
		<description><![CDATA[Anybody know how to insert a value for indentity column without using 
set identity_insert Temp on? 

My code looks like: 

CREATE TABLE Temp( 
ID INT IDENTITY(1,1) ) 

in this case how can i go for insert statement?]]></description>
		<content:encoded><![CDATA[<p>Anybody know how to insert a value for indentity column without using<br />
set identity_insert Temp on? </p>
<p>My code looks like: </p>
<p>CREATE TABLE Temp(<br />
ID INT IDENTITY(1,1) ) </p>
<p>in this case how can i go for insert statement?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-39759</link>
		<dc:creator><![CDATA[Phil]]></dc:creator>
		<pubDate>Fri, 04 Jul 2008 11:36:56 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-39759</guid>
		<description><![CDATA[Hey all, love the post! If like me you hate having to specify column names (as they will no doubt change), the following SQL will work on any table that has PK_FK contraints (where you need to SET IDENTITY_INSERT to ON/OFF and specify column names):

-- Create column list as you can&#039;t insert with identity insert = on without specifying column names!
DECLARE @ColumnList varchar(1000)
SELECT @ColumnList = COALESCE(@ColumnList + &#039;, &#039;, &#039;&#039;) + COLUMN_NAME 
FROM information_schema.columns WHERE table_name = &#039;Menu&#039; ORDER BY ORDINAL_POSITION

--Menu
SELECT @sql = 
&#039;SET IDENTITY_INSERT &#039; + @DestinationDB + &#039;.dbo.Menu ON;&#039; + 
&#039;INSERT INTO &#039; + @DestinationDB + &#039;.dbo.Menu (&#039; + @ColumnList + &#039;) SELECT &#039; + @ColumnList + &#039; FROM PizzaHutTemp.dbo.Menu;&#039; +
&#039;SET IDENTITY_INSERT &#039; + @DestinationDB + &#039;.dbo.Menu OFF;&#039;
EXEC (@sql)
PRINT @sql]]></description>
		<content:encoded><![CDATA[<p>Hey all, love the post! If like me you hate having to specify column names (as they will no doubt change), the following SQL will work on any table that has PK_FK contraints (where you need to SET IDENTITY_INSERT to ON/OFF and specify column names):</p>
<p>&#8211; Create column list as you can&#8217;t insert with identity insert = on without specifying column names!<br />
DECLARE @ColumnList varchar(1000)<br />
SELECT @ColumnList = COALESCE(@ColumnList + &#8216;, &#8216;, &#8221;) + COLUMN_NAME<br />
FROM information_schema.columns WHERE table_name = &#8216;Menu&#8217; ORDER BY ORDINAL_POSITION</p>
<p>&#8211;Menu<br />
SELECT @sql =<br />
&#8216;SET IDENTITY_INSERT &#8216; + @DestinationDB + &#8216;.dbo.Menu ON;&#8217; +<br />
&#8216;INSERT INTO &#8216; + @DestinationDB + &#8216;.dbo.Menu (&#8216; + @ColumnList + &#8216;) SELECT &#8216; + @ColumnList + &#8216; FROM PizzaHutTemp.dbo.Menu;&#8217; +<br />
&#8216;SET IDENTITY_INSERT &#8216; + @DestinationDB + &#8216;.dbo.Menu OFF;&#8217;<br />
EXEC (@sql)<br />
PRINT @sql</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joel</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-38180</link>
		<dc:creator><![CDATA[joel]]></dc:creator>
		<pubDate>Fri, 16 May 2008 06:26:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-38180</guid>
		<description><![CDATA[Hi All, I
 don&#039;t know if this helps.

This stored Procedure inserts in table [user], copy to table [copyuser] and finnaly, to delete from [user].

CREATE PROCEDURE copyto
	@id int

AS

SET IDENTITY_INSERT usersCopy off
insert into userscopy (first,last)values (&#039;first&#039;,&#039;last&#039;)
SET IDENTITY_INSERT users on
insert users ([id],[first]) select [id],[first] from usersCopy where id=@id
delete from userscopy where id=@id]]></description>
		<content:encoded><![CDATA[<p>Hi All, I<br />
 don&#8217;t know if this helps.</p>
<p>This stored Procedure inserts in table [user], copy to table [copyuser] and finnaly, to delete from [user].</p>
<p>CREATE PROCEDURE copyto<br />
	@id int</p>
<p>AS</p>
<p>SET IDENTITY_INSERT usersCopy off<br />
insert into userscopy (first,last)values (&#8216;first&#8217;,'last&#8217;)<br />
SET IDENTITY_INSERT users on<br />
insert users ([id],[first]) select [id],[first] from usersCopy where id=@id<br />
delete from userscopy where id=@id</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Damianinfo</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-38091</link>
		<dc:creator><![CDATA[Damianinfo]]></dc:creator>
		<pubDate>Thu, 15 May 2008 08:41:51 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-38091</guid>
		<description><![CDATA[Hi 
I got the same .. But what i did was before I used Select * for the inserting.. but now I manualy put all the column names in my insert and select query and it worked.]]></description>
		<content:encoded><![CDATA[<p>Hi<br />
I got the same .. But what i did was before I used Select * for the inserting.. but now I manualy put all the column names in my insert and select query and it worked.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: morrones</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-35176</link>
		<dc:creator><![CDATA[morrones]]></dc:creator>
		<pubDate>Thu, 17 Apr 2008 17:55:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-35176</guid>
		<description><![CDATA[For all the ones that have tried the command and are still getting the same error message, what you have to do is to explicitly add all the column names (including the ID one) to your insert statement.


SET IDENTITY_INSERT  ON

INSERT INTO  (, , ) VALUES (, , )

SET IDENTITY_INSERT  OFF

Regards,
Morrones]]></description>
		<content:encoded><![CDATA[<p>For all the ones that have tried the command and are still getting the same error message, what you have to do is to explicitly add all the column names (including the ID one) to your insert statement.</p>
<p>SET IDENTITY_INSERT  ON</p>
<p>INSERT INTO  (, , ) VALUES (, , )</p>
<p>SET IDENTITY_INSERT  OFF</p>
<p>Regards,<br />
Morrones</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dio</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-34818</link>
		<dc:creator><![CDATA[Dio]]></dc:creator>
		<pubDate>Thu, 03 Apr 2008 04:14:33 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-34818</guid>
		<description><![CDATA[Hi, I just add the column lists after the table name and I can insert identity table:

I have this table DataCategory: 
CREATE TABLE [dbo].[DataCategory](
	[CategoryNo] [int] IDENTITY(1,1) NOT NULL,
	[CategoryType] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NOT NULL,
	[CategoryID] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,
	[CategoryDescription] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,
 CONSTRAINT [PK_DataCategory] PRIMARY KEY CLUSTERED 
(
	[CategoryNo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]


Then I add the column list and can use this query to insert data : 

INSERT INTO DataCategory(CategoryNo, CategoryType,CategoryID,CategoryDescription) VALUES(@CategoryNo, &#039;Alarm&#039;, &#039;EQ&#039;, &#039;Alarm for EQ1&#039;)]]></description>
		<content:encoded><![CDATA[<p>Hi, I just add the column lists after the table name and I can insert identity table:</p>
<p>I have this table DataCategory:<br />
CREATE TABLE [dbo].[DataCategory](<br />
	[CategoryNo] [int] IDENTITY(1,1) NOT NULL,<br />
	[CategoryType] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NOT NULL,<br />
	[CategoryID] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,<br />
	[CategoryDescription] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,<br />
 CONSTRAINT [PK_DataCategory] PRIMARY KEY CLUSTERED<br />
(<br />
	[CategoryNo] ASC<br />
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]<br />
) ON [PRIMARY]</p>
<p>Then I add the column list and can use this query to insert data : </p>
<p>INSERT INTO DataCategory(CategoryNo, CategoryType,CategoryID,CategoryDescription) VALUES(@CategoryNo, &#8216;Alarm&#8217;, &#8216;EQ&#8217;, &#8216;Alarm for EQ1&#8242;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dio</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-34816</link>
		<dc:creator><![CDATA[Dio]]></dc:creator>
		<pubDate>Thu, 03 Apr 2008 04:12:32 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-34816</guid>
		<description><![CDATA[HI,

I just add the column list , and I can use Stored Procedures to add identity columns:

I have DateCategory table:
CREATE TABLE [dbo].[DataCategory](
	[CategoryNo] [int] IDENTITY(1,1) NOT NULL,
	[CategoryType] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NOT NULL,
	[CategoryID] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,
	[CategoryDescription] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,
 CONSTRAINT [PK_DataCategory] PRIMARY KEY CLUSTERED 
(
	[CategoryNo] ASC
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

--------------------
Then I can insert identity rows buy add in the column list:

INSERT INTO DataCategory(CategoryNo, CategoryType,CategoryID,CategoryDescription) VALUES(@CategoryNo, &#039;Alarm &#039;, EQ1, &#039;Alarm for EQ1&#039;)]]></description>
		<content:encoded><![CDATA[<p>HI,</p>
<p>I just add the column list , and I can use Stored Procedures to add identity columns:</p>
<p>I have DateCategory table:<br />
CREATE TABLE [dbo].[DataCategory](<br />
	[CategoryNo] [int] IDENTITY(1,1) NOT NULL,<br />
	[CategoryType] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NOT NULL,<br />
	[CategoryID] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,<br />
	[CategoryDescription] [varchar](100) COLLATE SQL_Latin1_General_CP437_CI_AS NULL,<br />
 CONSTRAINT [PK_DataCategory] PRIMARY KEY CLUSTERED<br />
(<br />
	[CategoryNo] ASC<br />
)WITH (PAD_INDEX  = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]<br />
) ON [PRIMARY]</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
Then I can insert identity rows buy add in the column list:</p>
<p>INSERT INTO DataCategory(CategoryNo, CategoryType,CategoryID,CategoryDescription) VALUES(@CategoryNo, &#8216;Alarm &#8216;, EQ1, &#8216;Alarm for EQ1&#8242;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Camillo Campolongo</title>
		<link>http://blog.sqlauthority.com/2007/03/28/sql-server-fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-33857</link>
		<dc:creator><![CDATA[Camillo Campolongo]]></dc:creator>
		<pubDate>Wed, 20 Feb 2008 14:13:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/03/28/fix-error-8101-an-explicit-value-for-the-identity-column-in-table-can-only-be-specified-when-a-column-list-is-used-and-identity_insert-is-on/#comment-33857</guid>
		<description><![CDATA[Thank to your suggestions, I solved this stupid problem in a stored proc after about two days of tentatives !

Many thanks !!!

Camillo]]></description>
		<content:encoded><![CDATA[<p>Thank to your suggestions, I solved this stupid problem in a stored proc after about two days of tentatives !</p>
<p>Many thanks !!!</p>
<p>Camillo</p>
]]></content:encoded>
	</item>
</channel>
</rss>

