I have given below an extended stored procedure which checks whether a filename given by user exists or not. I have named the extended stored procedure as sample_pro. I have given below the the sample_pro extended stored procedure

sample_pro[, output]

exec master..sample_pro 'c:\example.file'

declare @exists int

exec master..sample_pro 'c:\example.file', @exists output

print @exists

In the above in the first line the extended stored procedure named as sample_pro is called with parameters and the second parameter returns an integer value if the file exists. The second line exec master..sample_pro 'c:\example.file' checks whether the file named as example.file exists or not and returns the record details fully the output value namely the result of file named as example.file exists or not is returned as an integer to the extended stored procedure named as sample_pro in the rest of the lines written above.