I've been working with SQL Server for 12 years, but this short cut escaped me.
In Transact-SQL, the $IDENTITY keyword allows us to refer to the identity column without knowing its name. Since identity columns are often primary keys, we could use this as a short cut for always referring to the PK. This would be awesome to use in a code generator or an ORM.
This is not to be confused with @@IDENTITY or SCOPE_IDENTITY(), which tells us the actual number auto generated by the IDENTITY column (though each behaves in different ways.)
Test it out with this script:
use tempdb
go
create table test
(
id int identity(1,1)
, descr varchar(100)
)
go
insert into test
(descr)
values
('first record')
, ('second record')
, ('third record')
go
select $identity, descr from test
The innovative thinking of you in this blog. This blog makes me very useful to learn.
ReplyDeleteclinical sas training in chennai
clinical sas training
clinical sas Training in Velachery
SAS Training in Chennai
SAS Course in Chennai
Placement Training in Chennai
soft skills training in chennai
core java training in chennai
Great Article Cloud Computing Projects
DeleteNetworking Projects
Final Year Projects for CSE
JavaScript Training in Chennai
JavaScript Training in Chennai
The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training
These are really a superb showcases here I am glad to have a review of it and feel to roll on its steps for my benefit always.jogos friv gratis 2019
ReplyDeleteJogos 2019
jogos friv
Thanks for your efforts in sharing this post with us. This was really awesome. kindly keep continuing the great work.
ReplyDeleteSpoken English Classes in Chennai Anna Nagar
Spoken English Class in Porur
Spoken English Class in Vadapalani
Spoken English Class in Thiruvanmiyur
Spoken English Class in Chennai
Best English Speaking Classes in Mumbai
English Speaking Course in Mumbai
IELTS Training in Chennai
IELTS Coaching in Chennai
IELTS Mumbai