here i want to add logId from Login table and logtime to Logdetails table if uname and upasswd matches that in login table.. hw can i do this??
with below code logid is not getting added to logdetails table..but logtime is getting entered to Table..
create procedure [dbo].[login]
(
@uname NVARCHAR(20),
@upasswd NVARCHAR(20)
)
as
declare @status int,@logId int, @Logtime datetime=GETDATE()
if exists(select * from Login where uname=@uname and upasswd=@upasswd)
begin
insert into LogDetails(logId,Logtime) values(@logId,@Logtime)
set @status=1
end
else
set @status=0
select @status