473,776 Members | 1,572 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Return Record Number with query

12 New Member
I want to return record number with my query output.

I dont' want to use IDENTITY function and temp table for this purpose as I am dealing with very huge data.


any suggestions...




Riyaz
Mar 28 '07 #1
6 14402
Taftheman
93 New Member
I want to return record number with my query output.

I dont' want to use IDENTITY function and temp table for this purpose as I am dealing with very huge data.


any suggestions...




Riyaz
Hi can you explain a bit more please
Mar 28 '07 #2
CoolRiyaz
12 New Member
Hi can you explain a bit more please

Suppose my query is :

SELECT FirstName, LastName, Address FROM EmpMaster

I want the output like :

SrNo FirstName LastName Address
1 asas dfddsf dfdsf
2 dsfdsfdsf dfdsfdsf dfdfsdf
3 .... and so on


I dont want to use temp table and IDENTITY function as data is very very huge.

Any other solution?


Riyaz
Mar 28 '07 #3
iburyak
1,017 Recognized Expert Top Contributor
IF you use Server 2005.

Try this:

[PHP]select row_number() over (order by ID) as NumberItems, *
from table_name[/PHP]
Mar 28 '07 #4
CoolRiyaz
12 New Member
IF you use Server 2005.

Try this:

[PHP]select row_number() over (order by ID) as NumberItems, *
from table_name[/PHP]

Hi
sorry,
I am using SQL Server 2000

Now tell me what to do.


Thanks
Mar 29 '07 #5
iburyak
1,017 Recognized Expert Top Contributor
You can't get away without temp table on Server 2000.
If you want this solution let me know.


Thank you.
Mar 29 '07 #6
CoolRiyaz
12 New Member
You can't get away without temp table on Server 2000.
If you want this solution let me know.


Thank you.

I am already having this solution but now its performance issue on huge data.

Thanks for your inputs


Riyaz
Mar 29 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4529
by: Phil Powell | last post by:
My first time working with a PHP class, and after 6 hours of working out the kinks I am unable to return a value from the class, so now I appeal to the general audience what on earth did I do wrong this time? This is the code the retrieves the values: if (($hasRegistered || $hasPreRegistered) && !empty($uplinenumber)) { // CHECK TO SEE IF UPLINE NUMBER IS A VALID NUMBER $regNumberGenerator = new RegNumberGenerator($uplinenumber,...
8
4814
by: Adrian Parker | last post by:
Hi. I would like to query a database, given several where clauses to refine my search, and return the value of one single field in the database. eg: I have a table that lists teachers. Their first name, last name, age, unique teacher number, etc is in the file. I want to return the unique teacher number, for example, of the teacher whose first name is Jane and last name is Doe. How does one do this?
4
4762
by: Skully Matjas | last post by:
I am using the following code (created by the wizard) to allow to bring my form to a particular entery. But when I edit the entery (ex: put new information into a blank cell), it puts that record onto the bottom of the list (even though it keeps its record number). Also, There are certin names that i click on the list, and it will not bring it up, rather it brings to the first record (no matter how many times i try going to that...
2
2299
by: Megan | last post by:
Hi everybody- I have 2 tables, Hearings and Rulings. Both have primary keys called, CaseID, that are autonumbers. I don't want both tables to have the same autonumber. For example, if Hearings has 55, then I want Rulings to have a number greater than 55. Two or more Hearings may be entered before a Ruling is entered. For example, Hearings with CaseIDs= 55, 56, and 57 may be entered before a Ruling or vice versa. There is no definite...
3
6407
by: Chuck | last post by:
Hi, I have a somewhat unique problem (at least unique to me, and I've been doing this for longer than I care to admit). I have a client that needs to print cards onto perforated card stock (so multiple records per page), and they need to print out x copies of the same information onto the cards. So for instance I have a record that has a name, address, id number and then a number for the number of copies of that record that needs to be...
6
4849
by: jjturon | last post by:
Can anyone help me?? I am trying to pass a Select Query variable to a table using Dlookup and return the value to same select query but to another field. Ex. SalesManID SalesManName AT Alan Time
12
5579
by: magmike | last post by:
Accidentally deleted a record. Anyway to get it back? If not, I know the ID number - which is an autonumber field. Because of the related data from other tables, would I be able to create a new record and make its ID number, that of the deleted record? Thanks! magmike
0
2044
by: emalcolm_FLA | last post by:
Hello and TIA for any help with this non profit Christmas assistance project. I have an applicant (app history) and child (child history) tables (4 total). I need to grab the next available (in house case number, appt date and time) for the applicants yearly history and the childs yearly history and then print a report with the applicants info and this in house case number. The forms are linked with ID_app (from the applicant table).
4
6488
by: bruce24444 | last post by:
I'm working on a database created in Access 97 which has a form which tracks claims made for damages. When the person reports the claim, a form is used to enter Date Reported, Claim Number, Loss Type, Reported To, and Caller Name. This information is recorded into tbl:Claims_Assignment. I've been asked to create a form, to correct these initial details if entered incorrectly, so the end user doesn't have to go into tbl:Claims_Assignment,...
20
2536
by: tkip | last post by:
Hello everyone. I have been working on this DB for quite some time and still can't figure out a way to do what I want to do. It's a database that keep track of drawings and engineering change etc. Aslo, the tables for drawings are grouped by year. I have a Main Form and on that main form, several cmd buttons to initialize sub forms are located. There are a quite a few tables and the names are quite simple. For example, for drawing that are...
0
9464
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10289
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10120
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8952
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7471
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6722
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5367
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5493
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2860
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.