assuming this table id is an IDENTITY field
CREATE Procedure spAddSomething
(
@SSNO char(9),
@FirstName nvarchar(15),
@MidName nvarchar(15),
@LastName nvarchar(25)
)
AS
INSERT tblWhatever (
SSNO,
FirstName,
MidName,
LastName
) Values (
@SSNO,
@FirstName,
@MidName,
@LastName
)
SELECT @@IDENTITY AS 'Table_ID'
GO
Hope this helps
Shane
"smen" <sc****@hotmail.com> wrote in message
news:01****************************@phx.gbl...
hiye, i use sqlcommand.executescalar to insert datainto
my table hoping that it will return the table id, but its
not :(. can someone uot there tell mehows its done?
thanks in advance.