You are on page 1of 2

Table:

CREATE TABLE [dbo].[imgUpload](


[imgId] [int] IDENTITY(1,1) NOT NULL,
[imageName] [varchar](max) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[imgDesc] [varchar](50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
CONSTRAINT [PK_imgUpload] PRIMARY KEY CLUSTERED
(
[imgId] ASC
)WITH (PAD_INDEX = OFF, IGNORE_DUP_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]

----------------

create procedure [dbo].[sp_insertImage]


(
@imageName varchar(MAX),
@imgDesc varchar(50)
)
AS
Begin
insert into imgUpload values(@imageName,@imgDesc)
END

---------------

ALTER procedure [dbo].[sp_GetImageId]


(
@imgId int
)
AS
Begin
Select imgId,imageName,imgDesc from imgUpload where imgId=@imgId
END

----------
create procedure sp_GetImage
(
@imgId int,
@imageName varchar(Max),
@imgDesc varchar(50)
)
AS
Begin
Select imgId,imageName,imgDesc from imgUpload where imgId=@imgId
END
-----------

ALTER procedure [dbo].[sp_UpdateImage](


@imgId int,
@imageName varchar(MAX),
@imgDesc varchar(50)

)
AS
Begin
update imgUpload set imageName =@imageName,imgDesc=@imgDesc where imgId =@imgId
END

You might also like