 
SET ANSI_NULLS ON
 
GO
 
SET QUOTED_IDENTIFIER ON
 
GO
 
Create PROCEDURE [dbo].[ChatInsert]
 
@isOn bit 
 
AS
 
BEGIN
 
INSERT INTO Chat
 ( 
isOn
 
 ) 
 
values 
 (
 
@isOn
 
)
 
 RETURN @@IDENTITY
 
 END
 
SET ANSI_NULLS ON
 
GO
 
SET QUOTED_IDENTIFIER ON
 
GO
 

 
Create PROCEDURE [dbo].[ChatUpdate]
 
 
 
@ID int ,
 
@isOn bit 
 
AS
 
 
 
BEGIN
 
 
 
update Chat
 
 set 
 
isOn=@isOn
 
where ID=@ID
 
END
 
SET ANSI_NULLS ON
 
GO
 
SET QUOTED_IDENTIFIER ON
 
GO
 
Create PROCEDURE [dbo].[ChatDelete]
 
@ID int
 
AS
 
 
 
BEGIN
 
 
 
delete from Chat
 
 where ID=@ID
 
END
 
SET ANSI_NULLS ON
 
GO
 
SET QUOTED_IDENTIFIER ON
 
GO
 
Create PROCEDURE [dbo].[ChatGetOne]
 
@ID int
 
 
 
AS
 
 
 
BEGIN
 
 
 
select * from Chat
 
 where ID=@ID
 
END
 
SET ANSI_NULLS ON
 
GO
 
SET QUOTED_IDENTIFIER ON
 
GO
 
Create PROCEDURE [dbo].[ChatGetAll]
 
 
 
AS
 
 
 
BEGIN
 
 
 
select * from Chat order by ID desc
 
END
