17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 11: FileTablehow the object name <strong>of</strong> each object can be retrieved using the OBJECT_NAME() function.On your system, you should recognize the names <strong>of</strong> the objects, although the IDs andnumeric values at the end <strong>of</strong> the names will be different.select [object_id],OBJECT_NAME([object_id]) 'name',parent_object_id,OBJECT_NAME(parent_object_id) 'parent name'from sys.filetable_system_defined_objects/*object_id nameparent_object_id parent_name--------- ------------------------------ ---------------- -----------277576027 PK__Document__5A5B77D57DF9CB0A 261575970 Documents…581577110 DF__Documents__is_te__22AA2996 261575970 Documents*/Listing 11-28: Retrieving the names <strong>of</strong> the FileTable system-defined objects.Note that the objects included in this catalog view cannot be deleted. <strong>The</strong>y are anintegral part <strong>of</strong> the FileTable and will be deleted by <strong>SQL</strong> <strong>Server</strong> only if the FileTable itselfis deleted. <strong>The</strong> constraints can be disabled by disabling the FileTable namespace (seeFileTable namespace, above).sys.filetablesThis view lists information about the FileTables in the current database. <strong>The</strong> columns inthe sys.FileTables view are:• object_id – <strong>The</strong> object ID <strong>of</strong> the FileTable.• is_enabled – Returns 0 if the FileTable's namespace is not enabled and 1 if thenamespace is enabled.• directory_name – <strong>The</strong> name <strong>of</strong> the FileTable root directory.428

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!