ALTER PROC [dbo].[SP_Contact_Msg]
--@Reg_id as int,
@Email as varchar(50),
@txtName as varchar(50),
@txtBody as varchar(50),
@MsgType as varchar (20)
As
BEGIN
Declare @Reg_Id as int
Declare @DriverReg_id as int
set @Reg_Id= (select top 1 Reg_ Id from reg where Email=@Email)
set @DriverReg_id= (select top 1 DriverReg_id from DriverReg where Email=@Email)
if @Reg_id IS NOT NULL AND @DriverReg_id IS NOT NULL
BEGIN
INSERT INTO Contact(
Reg_id,
DriverReg_id,
Email,
txtName,
txtBody,
MsgType,
CreatedOn,
CreatedBy,
UpdatedBy,
UpdatedOn,
IsActive)
values
(
@Reg_id
,@DriverReg_id
,@Email
,@txtName
,@txtBody
,@MsgType
,GETDATE()
,1
,null
,null
,1)
End
else
BEGIN
INSERT INTO Contact(
Reg_id,
DriverReg_id,
Email,
txtName,
txtBody,
MsgType,
CreatedOn,
CreatedBy,
UpdatedBy,
UpdatedOn,
IsActive)
values
(
null,
@Email,
@txtName,
@txtBody,
@MsgType,
GETDATE(),
1,
null,
null,
1)
End
End
Loading
Nilesh SawardekarPosted Jul 12, 2016, 8:47 AM
kalu singh raoPosted Jul 11, 2016, 1:31 AM
ketan borsdiyaPosted Jul 11, 2016, 12:40 AM