473,396 Members | 1,886 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,396 software developers and data experts.

auto generate Number

G
Hello Firends

I want a sample code for developing an " auto genearte number " and want to
store in database.

Please if you find any code please send

Thanks in Advance
G
Dec 8 '06 #1
2 5800
Hi G

This would probably better posted to another group. however I have
found that it is better to allow the database to generate the the
number for you. If using access then try AUTONUMBER, if using oracle
then use a sequence to generate the number Not 100% sure about SQL but
I believe you can us @@Identity.

Reagrds
Tony

G wrote:
Hello Firends

I want a sample code for developing an " auto genearte number " and want to
store in database.

Please if you find any code please send

Thanks in Advance
G
Dec 9 '06 #2
SQL Server has an auto-increment field. @@Identity gets the value of the
identity column of the most recently added record using the same connection.

--
Mike Brind

<an***********@googlemail.comwrote in message
news:11**********************@n67g2000cwd.googlegr oups.com...
Hi G

This would probably better posted to another group. however I have
found that it is better to allow the database to generate the the
number for you. If using access then try AUTONUMBER, if using oracle
then use a sequence to generate the number Not 100% sure about SQL but
I believe you can us @@Identity.

Reagrds
Tony

G wrote:
>Hello Firends

I want a sample code for developing an " auto genearte number " and want
to
store in database.

Please if you find any code please send

Thanks in Advance
G

Dec 9 '06 #3

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

Similar topics

2
by: Laphan | last post by:
Hi All This is a strange request, but I just cannot fathom how to do it. In theory the requirement is very basic, but in practise its a noodle!! I have 10 team names like so: Team A Team...
8
by: Steven Burn | last post by:
I'm curious, I've written a very simple PIS (personal info store) that allows one to store whatever they wish..... the problem is, when one deletes an entry, the auto-numbering isn't corrected to...
5
by: Geoff Cayzer | last post by:
At http://www.blueclaw-db.com/tips_tricks.htm I came across a section which is included below and was hoping for some comment on the article. -------------- Almost never use this auto-number...
6
by: Sebastien | last post by:
Hi, I am building a products database, linking sales and production. Each part has a unique sales Stock Code and Production Number. The sales stock code is a combination of letters and numbers...
2
by: SalimShahzad | last post by:
Dear Gurus, i had written following codes to auto generate the next claim no Private Const strC = "GCT/02/J/" Private Sub Command1_Click() Dim stra, stre As String Dim intb, intd As Integer...
4
by: Shahar | last post by:
Hi I need to get a field name 'ID'(that is an auto-number field) right after I add a new row to table, it's work like that: myCommand.ExecuteNonQuery(); myCommand.CommandText = "SELECT...
3
by: arun_kumar112 | last post by:
dear sir, i wish to generate auto number starting from 1000 to 1000000. but each time number automatically generated no duplicate number generate assign. thanks, arun kumar
13
by: S.Dickson | last post by:
I had an access database that i use as an ordering system. I have a form for entering customer details. When i add a new customer on the form the customer number is an auto number that appears when...
1
by: Maninder Karir | last post by:
Hi Im stuck AGAIN!!!!!! Sure its something simple but, Ive put together a code to generate an automatic number everytime i open the work book, However I now would rather only generate the...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.