I am using LINQPad and I want to get the list of instance pipe names from the sys.dm_os_child_instances table. How is that expressed in LINQ-to-SQL?
This doesn't work:
from n in sys.dm_os_child_instances
select n
I don't think it matters, but I am using SQL Server Express 2008.
Also, yes, I know I can run raw SQL from LINQPad.
LINQ to SQL translates the queries you write into equivalent SQL queries and sends them to the server for processing. More specifically, your application uses the LINQ to SQL API to request query execution. The LINQ to SQL provider then transforms the query into SQL text and delegates execution to the ADO provider.
sys. tables is a system table and is used for maintaining information on tables in a database. For every table added to the database, a record is created in the sys. tables table.
LINQPad allows this query if you tick the 'Include System Views and SPs' checkbox in connection properties.
A couple of other points:
If you have capitalization enabled, it's sys.Dm_os_child_instances rather than sys.dm_os_child_instances
The query "from n in sys.Dm_os_child_instances select n" is valid but frivilous: you can just go "sys.Dm_os_child_instances"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With