title: Stored procedure with optional output
body: <p>I'm updating a stored procedure that checks for the presence of a local file, using a string as input. It's used as a sanity check for some SSIS packages, the only output it gives is whether it fails to find the file, in which case it will return an SQL Error.</p>
  
  <p>The procedure can handle wildcards, so I was thinking of expanding the procedure to return the name of the file it finds (And a new error if it gets multiple returns), which would be useful for dealing with packages that variable filenames but use flat file connectors. Adding an output parameter to the procedure means that you can't use the procedure unless you declare a variable to hold the output though.</p>
  
  <p>Is there a way to structure the procedure so that it only gives an output if someone specifies that they want said output? </p>