Solved

RowId In SQL Server

Posted on 2004-04-19
4
11,590 Views
Last Modified: 2009-07-29
How can i get the "RowId" of a table in Sql Server?
0
Comment
Question by:pradeepaga
  • 2
4 Comments
 
LVL 12

Expert Comment

by:ill
ID: 10858344
sql server 2000 doesn't support rowID.
0
 
LVL 13

Accepted Solution

by:
danblake earned 500 total points
ID: 10858375
There is no such thing as a RowId of a table in sql-server as an inbuilt function there is something called ROWGUIDCOL but this is something completly different.
Yukon is going to introduce a RowID functionality that is the similar to Oracle's RowId property
(RowID is an Oracle function -- that does not exist in SQL-Server).

This is normally acomplised in SQL-Server by adding an identity column (1,1) and calling it RowId
(But I wouldn't want to call it a RowID -- reserved word).

0
 
LVL 13

Expert Comment

by:danblake
ID: 10858382
Have a look here for the identity column implementation:
http://www.sql-server-performance.com/forum/topic.asp?TOPIC_ID=3385

0
 
LVL 34

Expert Comment

by:arbert
ID: 10859274
I agree that the identity method is usually the easiest way.  If you don't already have an identity column on your table, you can always insert into  a temp table and return the results.  If you do already have an identity column on your table and you can't have a gap between the numbers, you could also create a UDF that joins back to your original table and sequence the records that way.

Brett
0

Featured Post

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question