Last active
March 1, 2016 15:12
-
-
Save roe3p/76e04047c3cb448facd3 to your computer and use it in GitHub Desktop.
T-SQL function to check whether a file exists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ============================================= | |
-- Author: Rohan Shenoy | |
-- Create date: 2013-10-28 | |
-- Description: Function to return whether file exists | |
-- ============================================= | |
CREATE FUNCTION [dbo].[fnFileExists] (@path varchar(512)) RETURNS BIT | |
AS | |
BEGIN | |
DECLARE @result INT | |
EXEC master.dbo.xp_fileexist @path, @result OUTPUT | |
RETURN cast(@result AS BIT) | |
END | |
GO |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment