我正尝试在SQLServer 2014上的一个CodeFluent应用程序中为附件使用FileTable,但似乎无法获得正确的SQL (CREATE TABLE ...作为FileTable)。
有人知道如何在模型中定义这一点吗?
发布于 2015-12-04 04:11:38
不,CodeFluent实体不会生成FileTable。您可以在SQL脚本中创建它,然后将该脚本添加到您的解决方案中:SQL Server Producer - Custom scripts
但是,您可以使用FileTable来存储blobs。有两种使用FileTables的方法:
使用文件系统应用编程接口: FileTable可以作为经典文件夹进行访问,因此您可以使用文件系统二进制服务
<configuration>
<configSections>
<section name="Sample"type="CodeFluent.Runtime.CodeFluentConfigurationSectionHandler, CodeFluent.Runtime" />
</configSections>
<Sample binaryServicesTypeName="filesystem" fileSystemBlobStorageRootPath="path to file table" />
</configuration>使用T-SQL: CodeFluent实体不支持开箱即用的方法。但是,您可以通过创建一个继承自CodeFluent.Runtime.BinaryServices.BaseBinaryLargeObject的类并覆盖ProtectedSave、PersistenceLoad、PersistenceDelete、GetOutputStream、GetInputStream等方法来支持它们。然后,您可以在配置文件中声明您的二进制服务:
<configuration>
<configSections>
<section name="Sample" type="CodeFluent.Runtime.CodeFluentConfigurationSectionHandler, CodeFluent.Runtime" />
</configSections>
<Sample binaryServicesTypeName="Sample.FileTableBinaryServices, Sample" />
</configuration>https://stackoverflow.com/questions/34074850
复制相似问题