Q:

Global variable? Sharing variables across multiple scripts?

I have a few dozen scripts in the same project for querying different sets of data. I would like the input and output file paths to be the same in all my scripts.
I tried creating a basic method in my assembly:
namespace FilePaths 
{
    static public class Input 
    {
        static public string GetInputPath() 
        {
            string inputPath = "/some/path/{*}";
            return inputPath;
        }
    }
}

And then I try to call it like so:
USE DATABASE [master];
REFERENCE ASSEMBLY [Assemblies];
@in = FilePaths.Input.GetInputPath();

But I can't seem to get it to work... no matter what syntax I try, I get an error. Any help would be very appreciated.

A:

The Path expression has to be a so-called constant-foldable expression. Invoking a class method is not constant-foldable.
If you want to provide a common schema abstraction against a set of files, why don't you look into table-valued functions instead?

