Comments on: How to generate sequences and surrogate keys in generic SQL http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/ Stay curious! Fri, 10 May 2013 18:25:19 +0000 hourly 1 http://wordpress.org/?v=3.5.1 By: osql http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/#comment-4867 osql Wed, 07 Mar 2007 12:41:17 +0000 http://www.xaprb.com/blog/?p=136#comment-4867 I’ve already created the table, the column I want to have is a primary key number column, which has already got data inserted into it can you help?
I want the number to be auto generated.

]]>
By: Xaprb http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/#comment-2151 Xaprb Wed, 11 Oct 2006 12:50:47 +0000 http://www.xaprb.com/blog/?p=136#comment-2151 Not that I can think of right away. To do that you have to number the rows you’re inserting, and add an offset to make them begin at the largest number in the table. You could do this by simulating the ROW_NUMBER function, but it would be ugly at best.

]]>
By: Olle http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/#comment-2150 Olle Wed, 11 Oct 2006 10:25:11 +0000 http://www.xaprb.com/blog/?p=136#comment-2150 Is there a way to insert several rows at once and have the counter increment by one for each row? For instance “insert into t1log” with a select statement that returns several rows instead of one as in your example above?

]]>
By: Xaprb http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/#comment-1665 Xaprb Tue, 29 Aug 2006 11:39:31 +0000 http://www.xaprb.com/blog/?p=136#comment-1665 I know no way to do that. I suspect you have a serious flaw in your table design if you need this.

]]>
By: rabin nayak http://www.xaprb.com/blog/2006/04/20/sequences-and-surrogate-keys-in-generic-sql/#comment-1662 rabin nayak Tue, 29 Aug 2006 08:17:23 +0000 http://www.xaprb.com/blog/?p=136#comment-1662 How can I make two columns autoincrement simultaneously in a single table?

]]>