I follow an online example of how to create a file table with script like this
CREATE TABLE [dbo].[Users] AS FILETABLE ON [PRIMARY] FILESTREAM_ON [FGFS]
GO
And when I run the query like
SELECT * FROM sys.key_constraints WHERE parent_object_id=xxxxx
SELECT * FROM sys.index_columns WHERE object_id=yyyyy
The first one gives me 3 keys (1PK+2UQs)
How can I learn which one is
either FILETABLE_PRIMARY_KEY_CONSTRAINT_NAME
or FILETABLE_STREAMID_UNIQUE_CONSTRAINT_NAME
or FILETABLE_FULLPATH_UNIQUE_CONSTRAINT_NAME
?
Like any table, you can quickly get the index details with
sp_help
:The index details will be like:
The query below will return the constraint name and column name(s) using the catalog views: