6

Is there some efficient way how to get length of data in "varbinary(max) filestream" column? I found only samples with conversion to varchar and then calling the "LEN" function.

Bridge
  • 29,818
  • 9
  • 60
  • 82
TcKs
  • 25,849
  • 11
  • 66
  • 104

1 Answers1

16
SELECT
      length = DATALENGTH(Name),
      Name 
FROM 
      Production.Product 
ORDER BY 
      Name

"Returns the number of bytes used to represent any expression."

T-SQL and quote taken from MSDN's DATALENGTH (Transact-SQL) library.

Bern
  • 7,808
  • 5
  • 37
  • 47
Jan Remunda
  • 7,840
  • 8
  • 51
  • 60