Tuesday, April 16, 2019

Cannot access file_stream column in FileTable 'YourNameHere', because FileTable doesn't support row versioning. Either set transaction level to something other than READ COMMITTED SNAPSHOT or SNAPSHOT, or use READCOMMITTEDLOCK table hint.

SELECT * FROM [FunStuff].[dbo].[YourNameHere]

 
 

...needs to become:

SELECT * FROM [FunStuff].[dbo].[YourNameHere] WITH (READCOMMITTEDLOCK)

 
 

...to get out of the error. There are a couple of things to note here. One of them is that the stuff after a with in a table hint. This has some more on the hints in T-SQL. Also note that I am writing to and reading from a File Table. In the Object Explorer in SSMS (Microsoft SQL Server Management Studio), under a database, under Tables, there is a folder for FileTables. A file table will have a corresponding file share with it and you may just look into the file share like any other folder in Windows and you may write files into there from code or even drag and drop files in there manually if it suits you. The the table representation of the table (yes, there is duality) in SQL will have a file_stream column to represent the file itself and a stream_id column for a unique ID. This is somewhat off topic, but while I am writing of SSMS, here are the database role memberships for a login:

  1. db_accessadmin
  2. db_backupoperator
  3. db_datareader
  4. db_datawriter
  5. db_ddladmin
  6. db_denydatareader
  7. db_denydatawriter
  8. db_owner
  9. db_securityadmin
  10. public

No comments:

Post a Comment