USE [NganHangCauHoi]
GO
/****** Object: StoredProcedure [dbo].[ThemCauHoi] Script Date: 3/3/2023 8:40:57 AM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[ThemCauHoi]
@MaCauHoi NVARCHAR(500),
@NhomCauHoi VARCHAR(500),
@IDMonHoc INT,
@FilePath NVARCHAR(500)
AS
BEGIN
INSERT INTO TblCauHoi (MaCauHoi, NhomCauHoi, IDMonHoc, NoiDung)
SELECT @MaCauHoi, @NhomCauHoi, @IDMonHoc, *
FROM OPENROWSET(BULK ''' + + @FilePath + ''', SINGLE_BLOB) AS NoiDung
END
EXEC ThemCauHoi
@MaCauHoi = "0000001",
@NhomCauHoi = 'C1',
@IDMonHoc = 5,
@FilePath = 'E:\Example.docx'
It get the message
Cannot bulk load. The file "' + + @FilePath + '" does not exist or you don't have file access rights.
The path is correct and the file is there, what about the file access rights.