This is a discussion on SqlServer2000: autonumbering records - how to ? within the SQL Server forums, part of the Microsoft SQL Server category; --> I created table with "id" field as "uniqueidentifier" (primary key). I connect via ODBC from MS-Acces. -->>> Don't know ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| I created table with "id" field as "uniqueidentifier" (primary key). I connect via ODBC from MS-Acces. -->>> Don't know how to something like "Autonumber" in MS-Access. Let me know If any trigger or something like this is required. Please post some code of trigger if need. Until now I have only developed some native MS-Access databases. I hope there is some solution about "Autonumbering records" in SQLServer. SqlServer 2000, Access Xp. Marek Bħbski |
| |||
| autonumber = identity look it up in the books on line for examples and more info "netx" <user72wytnij@go2.pl> wrote in message news:423043e8$0$3231$f69f905@mamut2.aster.pl... >I created table with "id" field as "uniqueidentifier" (primary key). > > I connect via ODBC from MS-Acces. > -->>> Don't know how to something like "Autonumber" in MS-Access. > > Let me know If any trigger or something like this is required. > Please post some code of trigger if need. > Until now I have only developed some native MS-Access > databases. I hope there is some solution about "Autonumbering records" > in SQLServer. > > SqlServer 2000, Access Xp. > > Marek Bħbski > > > |
| ||||
| On Thu, 10 Mar 2005 13:59:10 +0100, netx wrote: >I created table with "id" field as "uniqueidentifier" (primary key). > >I connect via ODBC from MS-Acces. >-->>> Don't know how to something like "Autonumber" in MS-Access. (snip) Hi Marek, The equivalent of Access' autonumber in SQL Server is the IDENTITY property. For instance, to generate a surrogate key for invoices, you could use CREATE TABLE Invoices (InvID int NOT NULL IDENTITY, CustID int NOT NULL, Period smallint NOT NULL, -- other columns, PRIMARY KEY (InvID), UNIQUE (CustID, Period), FOREIGN KEY (CustID) REFERENCES Customers, FOREIGN KEY (Period) REFERENCES InvoicingPeriods ) Best, Hugo -- (Remove _NO_ and _SPAM_ to get my e-mail address) |