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

Continuously Transaction Number

im developing a web application for intranet solution. it have a transaction
named is "Receipt", two locations are use this. but receipt number should be
continue. who can i do this, please help me
Apr 30 '07 #1
3 994
Hi Menaka,

Menaka wrote:
im developing a web application for intranet solution. it have a transaction
named is "Receipt", two locations are use this. but receipt number should be
continue. who can i do this, please help me
if I understand you right, you want a web application to issue an
ascending unique number.

You could use an Auto Increment value in the backend database (e.g.
IDENTITY (1,1) in SQL Server), if you use a backend database. If it's
your Primary Key column, you can get the value after the insert with
SCOPE_IDENTITY() (SQL Server again).

Hope this helps,

Roland
Apr 30 '07 #2
"Roland Dick" <br*****@web.dewrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
You could use an Auto Increment value in the backend database (e.g.
IDENTITY (1,1) in SQL Server), if you use a backend database. If it's your
Primary Key column, you can get the value after the insert with
SCOPE_IDENTITY() (SQL Server again).
That will work so long as the OP does not mind the possibilty of gaps in the
sequence of receipt numbers:
http://msdn2.microsoft.com/en-us/lib...0(SQL.80).aspx

--
http://www.markrae.net

Apr 30 '07 #3
Mark Rae schrieb:
That will work so long as the OP does not mind the possibilty of gaps in
the sequence of receipt numbers:
That's true. By the way, that applies to all solutions with
unsynchronized access I can think of. If gaps are to be avoided, menaka,
you will have to use a mutex or something like that to make sure that
the whole procedure (getting a counter somehow, storing/doing whatever
with the data, incrementing the counter *if successful*) can only be
executed in exactly none or one thread.

As for the somehow... a MAX() on the database comes to mind, a counter
in a file, or even an application variable (which by itself of course
will not persist a shutdown of the server or site, but could be
initialized from the database in the Application_OnStart event). I'm
sure there's heaps of other possibilies as well...

Roland
Apr 30 '07 #4

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

Similar topics

5
by: BashiraInTrouble | last post by:
Hi Friends, I have tried almost everything but I cant seem to shrink the transaction log. Executing DBCC SQLPERF(LOGSPACE) gives me this info: Database Log Size (MB) Log Space Used (%) ...
0
by: Manoj Sharma | last post by:
I am performance testing some batch processing engines. These are written in ..NET and SQL Server and are typically concerned with generating XML files out of data retrieved from the database. I...
6
by: Prince Kumar | last post by:
I have a requirement where I have to generate sequnce like numbers within another key. My table is like, custrec ------- cust# seq# 10 1 10 2
3
by: t2581 | last post by:
Hi , I run restore with rollforward In job in output, last commited transaction time less then backup image time Is it normal ? RESTORE DATABASE PRICE_V8 FROM "E:\BACKUP" TAKEN AT...
5
by: J. Yuan | last post by:
Hi, I am working on a checkout/inventory system. How can I make a button that when pressed, would update the previous fields transaction number to a table (for example, -3 printers, so that...
15
by: Zeng | last post by:
Hi, The bigger my C# web-application gets, the more places I need to put in the tedious retrying block of code to make sure operations that can run into database deadlocks are re-run (retried)...
2
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
14
by: Jim Michaels | last post by:
mysql_query("START TRANSACTION", $link2); $q2=mysql_query("SELECT pictures.pid AS pid FROM pictures,counter WHERE pictures.pid>counter.pid LIMIT 1", $link2); if ($row2=mysql_fetch_assoc($q2)) {...
4
by: yashgt | last post by:
Hi, We have created a SQL server 2000 database. We observe that the transaction log keeps growing over time. We are now about to run out of space. We have been periodically shrinking the...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.