I have this stored procedure which is accessing a FileTable. This stored procedure is taking between 2 to 2.5 seconds to execute. I am looking for suggestions on how to better optimize this.
Thanks,
-Vernon
USE [BMIPictureDB] GO /****** Object: StoredProcedure [dbo].[GetFileTablePath] Script Date: 8/31/2015 6:07:37 AM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO ALTER PROCEDURE [dbo].[GetFileTablePath] ( @FileTableId nvarchar(MAX) ) AS BEGIN DECLARE @root nvarchar(100); DECLARE @fullpath nvarchar(1000); SELECT @root = FileTableRootPath(); SELECT @fullpath = @root + file_stream.GetFileNamespacePath() FROM DocumentStore WHERE path_locator.ToString() = @FileTableId SELECT @fullpath END