June 12, 2017 at 7:58 am
I have created a database that is named Products. This database contains two filegroups: PRIMARY and FileStreamGroup1. For the FileStreamGroup1 I have created the folder C:\Data.
In the Windows start menu I used SQL Server Configuration Manager to enable the Transact SQL access and Enable FILESTREAM for file I/O streaming access and i executed the following query in SSMS:
Finally, I have created a table called Package
USE [Products]
GO
CREATE TABLE [dbo].[Package](
[ID] [uniqueidentifier] ROWGUIDCOL NOT NULL,
[Product_code] [nvarchar](25) NOT NULL,
[Package_Code] [nvarchar](10) NOT NULL,
[Name_Package] [nvarchar](50) NOT NULL,
[Filename] [nvarchar](50) NULL,
[Document] [varbinary](max) FILESTREAM NULL,
[Start] [datetime] NULL,
[End] [datetime] NULL,
[Date] [datetime] NOT NULL,
[ListPrice] [money] NOT NULL,
CONSTRAINT [PK_package] PRIMARY KEY CLUSTERED
(
[Product_code] ASC,
[Package_Code] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY] FILESTREAM_ON [FileStreamGroup1],
UNIQUE NONCLUSTERED
(
[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] FILESTREAM_ON [FileStreamGroup1]
GO
ALTER TABLE [dbo].[Package] ADD DEFAULT (newid()) FOR [ID]
GO
I use SSIS to import the product rows from Excel to SQL Server.
The problem is that the column [Document] remains empty (NULL) even if the column [Filename] has a value (for example C:\Data\A0638-UP-2012 W26.docx).
Who can tell me what causues this problem and how to solve it?
July 12, 2017 at 6:11 am
I;ve figured it out myself with the help of some online articles.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply