Received: from mail.postgresql.org (webmail.postgresql.org [216.126.85.28]) by mail.postgresql.org (8.11.1/8.11.1) with SMTP id f2D1nux17615 for ; Mon, 12 Mar 2001 20:49:56 -0500 (EST) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2D00Tx00966 for ; Mon, 12 Mar 2001 19:00:29 -0500 (EST) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f2CNZxG90606 for pgsql-sql@postgresql.org; Mon, 12 Mar 2001 18:35:59 -0500 (EST) (envelope-from news) From: Carl van Tast X-Newsgroups: comp.databases.postgresql.sql Subject: Re: default value syntax - pg compared to? Date: Tue, 13 Mar 2001 00:34:09 +0100 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 31 Message-ID: <37mqat0o6n65n1f2lbbg9frd0hftvl39a0@4ax.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Newsreader: Forte Agent 1.8/32.548 To: pgsql-sql@postgresql.org X-Archive-Number: 200103/242 X-Sequence-Number: 1901 On Mon, 12 Mar 2001 20:52:02 +0000 (UTC), josh@agliodbs.com ("Josh Berkus") wrote: >1. Unlike PostgreSQL, MSSQL server will not permit you to override an >"Identity Value" auto-incrementing field; That's almost correct. You cannot *update* an identity column, but you can override it on insert if you use SET IDENTITY_INSERT tablename ON create table foo (id integer identity, txt varchar(10)) go insert into foo (txt) values ('a') insert into foo (txt) values ('b') set identity_insert foo on insert into foo (id, txt) values (10, 'c') set identity_insert foo off insert into foo (txt) values ('b') select * from foo id txt ----------- ---------- 1 a 2 b 10 c 11 d (4 row(s) affected) .02 by Carl van Tast