x

How to fetch last inserted row

Hi, can anyone let me know how to fetch/get last inserted row in sql server. Table have NO Primary key, Identity, it has only one column 'Employee Name'.

more ▼

asked Apr 23, 2010 at 09:11 AM in Default

avatar image

Vijay 3
11 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

You can't get it as there is no way to tell it was the last inserted, either add a primary key or a date added field.

more ▼

answered Apr 26, 2010 at 05:33 AM

avatar image

RickD
1.7k 2 3 6

(comments are locked)
10|1200 characters needed characters left

You can not fetch data while there is no primary key you should add one primary key or date time field.

more ▼

answered Apr 26, 2010 at 08:37 AM

avatar image

Gaurav 1
2

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x501

asked: Apr 23, 2010 at 09:11 AM

Seen: 1216 times

Last Updated: Apr 23, 2010 at 09:11 AM

Copyright 2016 Redgate Software. Privacy Policy