Question of the month May 2016- What does SELECT $identity from Table return?

Let us consider the following dataset

Create table testing(id int identity(1,1),name varchar(100));

insert into testing(name)
select ‘test1’ union all
select ‘test2’;

select $identity from testing;

What is the result and what is $identity?

Advertisements

2 thoughts on “Question of the month May 2016- What does SELECT $identity from Table return?

  1. It will return id column value 1 and 2 ..

    It is used when you do not know the identity column name and want to see the identity values stored in table.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s