﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by Anuradha Mathur  / Identity_column / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Thu, 20 Jun 2013 04:18:54 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>It was straight forward Q, and had a straight forward ans. :-)</description><pubDate>Mon, 23 Nov 2009 23:01:40 GMT</pubDate><dc:creator>Bhavesh_Patel</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>I too missed the extra comma but saw the intent of the question.  Despite that, it is nice to have learned something about the extra comma in table creates.</description><pubDate>Tue, 25 Aug 2009 12:03:27 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>yup</description><pubDate>Fri, 17 Jul 2009 21:15:23 GMT</pubDate><dc:creator>Papo Rivera</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>sorry - posted about the comma without seeing all the other posts - dunno whats wrong with this browser of mine...</description><pubDate>Fri, 17 Jul 2009 16:42:57 GMT</pubDate><dc:creator>mister.magoo</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>Actually the answer is "NONE OF THE ABOVE".  The answer (deemed correct) refers to IDENTITY INSERT set to ON.  This query will run if IDENTITY INSERT is set to on.  However, it is off.  The actual error message refers to IDENTITY INSERT SET TO OFF.  Minor verbiage change, but can make a big difference (several previous questions had details like this that made the difference between right and wrong so consistency should be maintained).CORRECTION: I just now saw the "not". The error message actually says "hen IDENTITY_INSERT is set to OFF"  The "not" through me off.  Cheers,Brian</description><pubDate>Fri, 17 Jul 2009 11:48:22 GMT</pubDate><dc:creator>beezell</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>didn't notice the comma, but I realized the intent of the question.</description><pubDate>Fri, 17 Jul 2009 10:22:19 GMT</pubDate><dc:creator>Steve Jones - SSC Editor</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>I'm with you guys, I assumed that the comma would cause it to error before the table even got created. So, despite the ambiguous choices, learned something new!:-D</description><pubDate>Fri, 17 Jul 2009 06:45:27 GMT</pubDate><dc:creator>jcrawf02</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>I stand corrected.  I just tried this query, as written, on both SQLServer 2000 and 2005 and the table DOES get created, even in spite of the extra comma.Jim</description><pubDate>Fri, 17 Jul 2009 06:07:15 GMT</pubDate><dc:creator>jimkern</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>Which version is giving you an error message?It executes fine in 2008. I tried because my recollection was that the comma does not cause a problem and hasn't for several versions.create table employe (id_num int identity(1,1),fname varchar(20),lname varchar(20),)Command(s) completed successfully.</description><pubDate>Fri, 17 Jul 2009 06:07:10 GMT</pubDate><dc:creator>brdudley</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>Although I got the question right (I did not notice the extra comma), I agree this is a bad question.  When you get the error message, no records get inserted into the table.  Both the first and last option was correct.I knew either of them could have been the correct answer but the last one was more specific to the problem on why no records would have been inserted.  Still, I believe anyone who selects the first answer should also get it right.</description><pubDate>Fri, 17 Jul 2009 05:45:52 GMT</pubDate><dc:creator>cengland0</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>I'm sorry but you're wrong.  This query as written will fail for syntax reasons.  The comma after lname varchar(20), requires that another field be listed next, but one is not listed, therefore it will fail (which is answer A).</description><pubDate>Fri, 17 Jul 2009 05:36:55 GMT</pubDate><dc:creator>grulke</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>The syntax is forgiving about the extra comma. I tried it and was able to create the table per the script. Seems this has come up in the course of my typing Create statements -- add the comma by default then decide no more columns are needed and the table still creates. Another example is when generating Create Table statements.</description><pubDate>Fri, 17 Jul 2009 04:55:41 GMT</pubDate><dc:creator>brdudley</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>True, but that won't cause no rows to be inserted, it''l stop the table creation in the first place...</description><pubDate>Fri, 17 Jul 2009 04:00:44 GMT</pubDate><dc:creator>Andeavour</dc:creator></item><item><title>RE: Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>Actually, won't the comma after the lname column cause a syntax error?  So, of those answers, "no rows will be inserted" is technically the most correct answer.Jim</description><pubDate>Fri, 17 Jul 2009 03:36:50 GMT</pubDate><dc:creator>jimkern</dc:creator></item><item><title>Identity_column</title><link>http://www.sqlservercentral.com/Forums/Topic754586-1599-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/T-SQL/66598/"&gt;Identity_column&lt;/A&gt;[/B]</description><pubDate>Thu, 16 Jul 2009 21:28:06 GMT</pubDate><dc:creator>anu1krishna</dc:creator></item></channel></rss>