Home Forums SQL Server 2014 Administration - SQL Server 2014 FileTable issue RE: FileTable issue
March 4, 2018 at 5:27 am
Eirikur Eiriksson - Sunday, March 4, 2018 4:22 AMVastSQL - Sunday, March 4, 2018 2:57 AMEirikur Eiriksson - Sunday, March 4, 2018 2:21 AMVastSQL - Sunday, March 4, 2018 2:10 AMHi Experts,I have created a filetable with full access and created a trigger on Filetable to insert the filename and streamid to another normal table.Everything was working as expect but when i moved the same setup from one server to another the file insertion to folder failed with below errors.
--when tried using TQL
Msg 33409, Level 16, State 1, Line 11
The operation caused a FileTable check constraint error. A file entry cannot have a NULL value for the data stream associated with the row. Insert file data or use 0x to insert a zero length file.--when copied the file to location
The system cannot find message text for message number 0xfilename.sql in the message file for (null).if i remove the trigger the copying works fine.
The difference between two servers are one is using disks and the other one is having mount points.
Is the one failing the one with the mount pints?
😎
It might also be helpful if you post the trigger code.Thanks Eirikur for the quick reply.
Yes its failing in server with Mount Points. Please find the trigger code
Create TRIGGER [dbo].[Insert_Datain] ON [dbo].[BizTalkFT]
FOR INSERT AS
DECLARE @Stream_ID uniqueidentifier
DECLARE @Filename nVARCHAR(100)
DECLARE @CreateDate DAtetimeSELECT @Stream_ID =([Stream_id]) FROM INSERTED
SELECT @Filename=([name]) FROM INSERTED
SELECT @CreateDate=(Creation_Time) FROM INSERTEDINSERT INTO
[AllDocs]
([Filename],CreateDate)
VALUES
(
@Filename,@CreateDate
)
GOMy suggestion would be to change the trigger, regardless whether that is the cause of the problem or not, as this code can only handle single row inserts.
😎
CREATE TRIGGER [dbo].[Insert_Datain] ON [dbo].[BizTalkFT]
FOR INSERT ASINSERT INTO [AllDocs] ([Stream_id],[Filename],CreateDate)
SELECT
I.[Stream_id]
,I.[Filename]
,I.CreateDate
FROM INSERTED I
WHERE I.[Stream_id] IS NOT NULL;
GO
Thanks Eirikkur .
Can you give a suggestion on how to handle this ? Is there any other way to achieve this?