SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


FileTable issue


FileTable issue

Author
Message
VastSQL
VastSQL
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32079 Visits: 5875
Hi 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.
Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156605 Visits: 23008
VastSQL - Sunday, March 4, 2018 2:10 AM
Hi 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?
Cool
It might also be helpful if you post the trigger code.

VastSQL
VastSQL
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32079 Visits: 5875
Eirikur Eiriksson - Sunday, March 4, 2018 2:21 AM
VastSQL - Sunday, March 4, 2018 2:10 AM
Hi 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?
Cool
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 DAtetime

SELECT @Stream_ID =([Stream_id]) FROM INSERTED
SELECT @Filename=([name]) FROM INSERTED
SELECT @CreateDate=(Creation_Time) FROM INSERTED


INSERT INTO
[AllDocs]
([Filename],CreateDate)
VALUES
(
@Filename,@CreateDate
)
GO

Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156605 Visits: 23008
VastSQL - Sunday, March 4, 2018 2:57 AM
Eirikur Eiriksson - Sunday, March 4, 2018 2:21 AM
VastSQL - Sunday, March 4, 2018 2:10 AM
Hi 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?
Cool
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 DAtetime

SELECT @Stream_ID =([Stream_id]) FROM INSERTED
SELECT @Filename=([name]) FROM INSERTED
SELECT @CreateDate=(Creation_Time) FROM INSERTED


INSERT INTO
[AllDocs]
([Filename],CreateDate)
VALUES
(
@Filename,@CreateDate
)
GO

My 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.
Cool


CREATE TRIGGER [dbo].[Insert_Datain] ON [dbo].[BizTalkFT]
FOR INSERT AS

INSERT 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


VastSQL
VastSQL
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32079 Visits: 5875
Eirikur Eiriksson - Sunday, March 4, 2018 4:22 AM
VastSQL - Sunday, March 4, 2018 2:57 AM
Eirikur Eiriksson - Sunday, March 4, 2018 2:21 AM
VastSQL - Sunday, March 4, 2018 2:10 AM
Hi 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?
Cool
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 DAtetime

SELECT @Stream_ID =([Stream_id]) FROM INSERTED
SELECT @Filename=([name]) FROM INSERTED
SELECT @CreateDate=(Creation_Time) FROM INSERTED


INSERT INTO
[AllDocs]
([Filename],CreateDate)
VALUES
(
@Filename,@CreateDate
)
GO

My 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.
Cool


CREATE TRIGGER [dbo].[Insert_Datain] ON [dbo].[BizTalkFT]
FOR INSERT AS

INSERT 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?

Eirikur Eiriksson
Eirikur Eiriksson
SSC Guru
SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)SSC Guru (156K reputation)

Group: General Forum Members
Points: 156605 Visits: 23008
Can you post the DDL for the AllDocs table please.
Cool

This method is what I recommend, just wondering why you are getting NULL values for the Stream_id. Could be permissions issue, can you check that?
Is the new server a cluster?
VastSQL
VastSQL
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32079 Visits: 5875
Eirikur Eiriksson - Sunday, March 4, 2018 7:05 AM
Can you post the DDL for the AllDocs table please.
Cool

This method is what I recommend, just wondering why you are getting NULL values for the Stream_id. Could be permissions issue, can you check that?
Is the new server a cluster?

Thanks Eirikur.

Strem_ID was never Null

CREATE TABLE [dbo].[AllDocs](
[ID] [bigint] IDENTITY(1,1) NOT NULL,
[Stream_ID] [uniqueidentifier] NOT NULL,
[FileName] [nvarchar](100) NOT NULL,
[ToProcess] [int] NOT NULL,
[CreateDate] [datetime] NOT NULL,
CONSTRAINT [PK_AllDocs] PRIMARY KEY CLUSTERED
(
[ID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[AllDocs] ADD DEFAULT ((0)) FOR [ToProcess]
GO

VastSQL
VastSQL
SSC-Dedicated
SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)SSC-Dedicated (32K reputation)

Group: General Forum Members
Points: 32079 Visits: 5875
..

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search