Code proceure inster update select post Articles

Code proceure inster update select post Articles

Code proceure inster update select post Articles

Code procedure insert update delete

--==============================================
-- Author: ATC  @ 2022
-- Create date: 1/6/2022 10:55:09 PM
-- Project: megastore
-- Description: Auto code by ATC 
--==============================================
USE [megastore]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Articles_Insert]
@ID int ,
@NAME nvarchar (500),
@NOIDUNG ntext ,
@MOTA ntext ,
@IMG nvarchar (500),
@CATEGORY nvarchar (100),
@ALIAS nvarchar (500),
@META_TAG nvarchar (500),
@METATITLE nvarchar (500),
@META_DES nvarchar (500),
@DATEVIEW datetime ,
@DATEPOST datetime ,
@USERPOST nvarchar (100),
@STATUS bit ,
@KEYID nvarchar (100),
@LANG nvarchar (100)
as
  IF NOT EXISTS (SELECT * FROM  [Articles] WHERE  [ID][email protected] )
 BEGIN
Insert into [Articles]
([ID],[NAME],[NOIDUNG],[MOTA],[IMG],[CATEGORY],[ALIAS],[META_TAG],[METATITLE],[META_DES],[DATEVIEW],[DATEPOST],[USERPOST],[STATUS],[KEYID],[LANG])
Values
(@ID,@NAME,@NOIDUNG,@MOTA,@IMG,@CATEGORY,@ALIAS,@META_TAG,@METATITLE,@META_DES,@DATEVIEW,@DATEPOST,@USERPOST,@STATUS,@KEYID,@LANG)
END
--==============================================
-- Author: ATC  @ 2022
-- Create date: 1/6/2022 10:55:09 PM
-- Project: megastore
-- Description: Auto code by ATC 
-- Website: http://.www.atcpro.info
--==============================================
USE [megastore]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Articles_Update]
@ID int ,
@NAME nvarchar (500),
@NOIDUNG ntext ,
@MOTA ntext ,
@IMG nvarchar (500),
@CATEGORY nvarchar (100),
@ALIAS nvarchar (500),
@META_TAG nvarchar (500),
@METATITLE nvarchar (500),
@META_DES nvarchar (500),
@DATEVIEW datetime ,
@DATEPOST datetime ,
@USERPOST nvarchar (100),
@STATUS bit ,
@KEYID nvarchar (100),
@LANG nvarchar (100)
as
  IF  EXISTS (SELECT * FROM  [Articles] WHERE [ID][email protected] )
BEGIN
Update [Articles]  Set
 [NAME]= @NAME,[NOIDUNG]= @NOIDUNG,[MOTA]= @MOTA,[IMG]= @IMG,[CATEGORY]= @CATEGORY,[ALIAS]= @ALIAS,[META_TAG]= @META_TAG,[METATITLE]= @METATITLE,[META_DES]= @META_DES,[DATEVIEW]= @DATEVIEW,[DATEPOST]= @DATEPOST,[USERPOST]= @USERPOST,[STATUS]= @STATUS,[KEYID]= @KEYID,[LANG]= @LANG
 Where ([ID]= @ID)
END
--==============================================
-- Author: ATC  @ 2022
-- Create date: 1/6/2022 10:55:10 PM
-- Project: megastore
-- Description: Auto code by ATC 
-- Website: http://.www.atcpro.info
--==============================================
USE [megastore]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[Articles_Delete]
@ID int 
as
BEGIN
Delete [Articles]
 Where  ([ID]= @ID)
END
--==============================================
-- Author: ATC  @ 2022
-- Create date: 1/6/2022 10:55:10 PM
-- Project: megastore
-- Description: Auto code by ATC 
-- Website: http://.www.atcpro.info
--==============================================
USE [megastore]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE   PROCEDURE [dbo].[Articles_SelectAll]
as
BEGIN
SELECT * FROM [Articles]
END

 


Tags

admin

Hãy chia sẽ cảm nghĩ của bạn về bài viết trên nhé !

0 Nhận xét

  • Hãy trở thành người đầu tiên viết chia sẽ cảm nghĩ của mình bên dưới nhé!

Thêm Bình luận