Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

The Voice of the DBA

Steve Jones is the editor of SQLServerCentral.com and visits a wide variety of data related topics in his daily editorial. Steve has spent years working as a DBA and general purpose Windows administrator, primarily working with SQL Server since it was ported from Sybase in 1990. You can follow Steve on Twitter at twitter.com/way0utwest

FileTables–Inserting Directories from T-SQL

Creating a directory in a Filetable share is easy. It looks like this:

filetable_i

It’s hard to see, but this was a right click, New, Folder in the share from Windows Explorer.

However what about creating a directory from T-SQL? That’s almost as easy.

I created that folder above by running this code:

-- create a folder
INSERT  INTO dbo.Explorer
        ( name, is_directory )
VALUES  ( 'Books', 1 );

I provided a name for my folder and then a 1 for the is_directory property. Once I ran this, the folder above appeared in my share.

Note that this works for folders in the root, but not nested folders. I’ll tackle that in another post.


Filed under: Blog Tagged: Filetable, sql server, syndicated, T-SQL

Comments

Leave a comment on the original post [voiceofthedba.wordpress.com, opens in a new window]

Loading comments...