473,405 Members | 2,300 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

SqlServer2000: autonumbering records - how to ?

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

Jul 23 '05 #1
2 1452
autonumber = identity

look it up in the books on line for examples and more info

"netx" <us**********@go2.pl> wrote in message
news:42*********************@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

Jul 23 '05 #2
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)
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Ioannis Demetriades | last post by:
Hi, I am doing a VB.NET application with SQL Server 2000 and I need to implement a database search facility that will normally return lots of records. Those records will then be displayed in a...
4
by: Chris | last post by:
Hi, I have a table in SQLServer2000 where e.g. the actual time is insert for every record (smalldatetime). But how do I select every records newer than 90 minutes? /Chris
2
by: Richard | last post by:
Hi, Could anyone help me with the following problem? I created a database for scientific documents, using the usual AutoNumbering for creating Document_ID's (primary key). The Document_ID's...
2
by: N. Graves | last post by:
Hey is there a command like in SQL Transactional that will reset the Autonumber field to the highest number in the found in the field? I developing a access database with a several table that...
7
by: lewi | last post by:
I have a ASP.NET app that I want to add user login data and use a Primary Key for an UserID number now I tried INSERT INTO SQL statement(I didn't include the Primay Key column in both (...) for the...
1
by: Marc | last post by:
Hi, I made a detailsview for inserting records. I also made a gridview for editing and deleting the same records. The keyfield is an autonumbering field in Access (pcnr). My problem is: I can...
2
by: red_valsen | last post by:
I have a default installation of SQLServer2000 on a host running Win2003. I want to install SQLServer2005 on the same machine, but preserve the original SQLServer2000 installation. How do I do...
1
by: aling | last post by:
Damn! SQLServer2000 can't add a NOT NULL COLUMN even in one empty existing table! That is, A is the existing table and it is emtpy, I want to add one NOT NULL COLUMN (col_new) to A using following...
1
by: FRENCH GUY | last post by:
Hi everyone, At the moment, I am working on a database with several tables. Almost every table has her own autonumbering field. So herefore, I am looking for the command that I have to include in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.