var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How to get vaue of last row inserted?...
I have a stored procedure--
CREATE PROCEDURE [dbo].[spOrderNew]
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
declare @varCustomerId int
declare @varOid int
insert into tblCustomers(CustomerName,Address,PhoneNo)
set @varCustomerId = SCOPE_IDENTITY()
insert into tblOrder(OrderDate,CustomerId)
set @varOid = SCOPE_IDENTITY()
insert into tblOrderItems(Pid,QtyOrdered,Amount,Oid)
Now, i am running my first insert query from codebehind and i would remove this query from procedure.How can i get the value of last row inserted into tblCustomers to variable @varCustomerId?...
SCOPE_IDENTITY() not working? I don't understand the problem.
not sure I understand either. But I know you can do "select ident_current('tablename') as value" to get the identity of the last record inserted into that row.
select top 1 id from table order by id desc, no?
better question is why do you need it?