<p>We are using Linq To SQL with our own data context logic that executes the one linq query across multiple databases.  When we get the results back, we need the database for each of the rows.  So...</p>

<p>I want to have a property on my class that will return the database name (SQL Server, so DB_NAME()).  How can I do this in Linq To Sql?</p>

<hr>

<p>Dave, thanks for the answer, but we have hundreds of databases and don't want to have to add views if possible.</p>

I tried to do that recently and couldn't get it to work. What I ended up doing is sending a variable at startup. So say you have an environment variable called $LOG_LEVEL:
```
```
<level value="${log_level}" />
```
```
and at startup...
```
```
java -Dlog_level=$LOG_LEVEL your_app
```
```