Create a Stored Proc to do your inserts. Here's a sample you can run in Query Analyzer....
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS OFF
GO
CREATE PROCEDURE dbo.Some_Stored_Proc
@Fname varchar(30)= null,-- not required
@Lname varchar(30)--required
AS
declare @id int
SET @id = 0
if (@Lname != '')--ensures a valid input
BEGIN
Begin transaction
INSERT INTO Table1
([Fname],[Lname],[date_created])
Values (@Fname, @Lname,getdate())
SET @id = @@IDENTITY
commit transaction
return @id --return the new ID number to the caller
END
SET QUOTED_IDENTIFIER OFF
GO
SET QUOTED_IDENTIFIER OFF
GO
SET ANSI_NULLS ON
GO