Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-05-23 : 09:00:47
|
Jeyakumar writes "Dear Team,I am using SQL Server 2005 version. I need to Get the running Sl.No from the Table (Which is not a primary key in that table).Incase of SCOPE_IDENTITY() , i hope it works with Unique ID (PK).In my case , Primary key is a different one. But at the same time i want to keep incrementing the SlNo for every new row inertion from my Application program using ASP.NET.Pls help me in this. Thanks.Regards,Jeyakumar.Sjeyakumar.vs@gmail.com" |
|
JBelthoff
Posting Yak Master
173 Posts |
Posted - 2006-05-23 : 11:14:56
|
Can't you do it like this..?Declare @siNum int After your insert...Select @siNum = SCOPE_IDENTITY() --ThenSelect Sl.No from YourTableWhere PK = @siNum JBelthoffDodge, Duck, Dip, Dive & DodgeIf a man can dodge a wrench, he can dodge a ball! Asp Hoting Provider |
 |
|
|
|
|