Search Preview
OrcaMDF Now Exposes Metadata Through System DMVs | Mark S. Rasmussen
improve.dkMark S. Rasmussen improve.dk About Me Pages
.dk > improve.dk
SEO audit: Content analysis
Language | Error! No language localisation is found. | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Title | OrcaMDF Now Exposes Metadata Through System DMVs | Mark S. Rasmussen | ||||||||||||||||||||||||||||||||||||
Text / HTML ratio | 41 % | ||||||||||||||||||||||||||||||||||||
Frame | Excellent! The website does not use iFrame solutions. | ||||||||||||||||||||||||||||||||||||
Flash | Excellent! The website does not have any flash contents. | ||||||||||||||||||||||||||||||||||||
Keywords cloud | SQL Server OrcaMDF var = DMVs columns – tables sys systables syscolumns metadata Rasmussen Mark builtin abstraction list == user | ||||||||||||||||||||||||||||||||||||
Keywords consistency |
|
||||||||||||||||||||||||||||||||||||
Headings |
|
||||||||||||||||||||||||||||||||||||
Images | We found 1 images on this web page. |
SEO Keywords (Single)
Keyword | Occurrence | Density |
---|---|---|
SQL | 15 | 0.75 % |
Server | 14 | 0.70 % |
OrcaMDF | 11 | 0.55 % |
var | 9 | 0.45 % |
= | 8 | 0.40 % |
DMVs | 8 | 0.40 % |
columns | 7 | 0.35 % |
– | 4 | 0.20 % |
tables | 4 | 0.20 % |
sys | 3 | 0.15 % |
systables | 3 | 0.15 % |
syscolumns | 3 | 0.15 % |
metadata | 3 | 0.15 % |
Rasmussen | 3 | 0.15 % |
Mark | 3 | 0.15 % |
builtin | 3 | 0.15 % |
abstraction | 3 | 0.15 % |
list | 3 | 0.15 % |
== | 3 | 0.15 % |
user | 2 | 0.10 % |
SEO Keywords (Two Word)
Keyword | Occurrence | Density |
---|---|---|
SQL Server | 14 | 0.70 % |
of the | 6 | 0.30 % |
like this | 3 | 0.15 % |
in OrcaMDF | 3 | 0.15 % |
the builtin | 3 | 0.15 % |
as well | 3 | 0.15 % |
Mark S | 2 | 0.10 % |
Databasenew CTestmdf | 2 | 0.10 % |
var sys | 2 | 0.10 % |
CTestmdf var | 2 | 0.10 % |
I might | 2 | 0.10 % |
= dbDmvs | 2 | 0.10 % |
new Databasenew | 2 | 0.10 % |
= new | 2 | 0.10 % |
db = | 2 | 0.10 % |
var db | 2 | 0.10 % |
system DMVs | 2 | 0.10 % |
using var | 2 | 0.10 % |
DMVs from | 2 | 0.10 % |
syscolumns sysindexes | 2 | 0.10 % |
SEO Keywords (Three Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
Mark S Rasmussen | 2 | 0.10 % | No |
= new Databasenew | 2 | 0.10 % | No |
foreach var col | 2 | 0.10 % | No |
DMVs from SQL | 2 | 0.10 % | No |
the builtin DMVs | 2 | 0.10 % | No |
using var db | 2 | 0.10 % | No |
var db = | 2 | 0.10 % | No |
db = new | 2 | 0.10 % | No |
new Databasenew CTestmdf | 2 | 0.10 % | No |
SQL Server OrcaMDF | 2 | 0.10 % | No |
Databasenew CTestmdf var | 2 | 0.10 % | No |
CTestmdf var sys | 2 | 0.10 % | No |
var sys = | 2 | 0.10 % | No |
sys = dbDmvs | 2 | 0.10 % | No |
= dbDmvs var | 2 | 0.10 % | No |
in columns ConsoleWriteLinecolName | 2 | 0.10 % | No |
col in columns | 2 | 0.10 % | No |
in SQL Server | 2 | 0.10 % | No |
var col in | 2 | 0.10 % | No |
of the builtin | 2 | 0.10 % | No |
SEO Keywords (Four Word)
Keyword | Occurrence | Density | Possible Spam |
---|---|---|---|
foreach var col in | 2 | 0.10 % | No |
sys = dbDmvs var | 2 | 0.10 % | No |
using var db = | 2 | 0.10 % | No |
var db = new | 2 | 0.10 % | No |
db = new Databasenew | 2 | 0.10 % | No |
= new Databasenew CTestmdf | 2 | 0.10 % | No |
Databasenew CTestmdf var sys | 2 | 0.10 % | No |
CTestmdf var sys = | 2 | 0.10 % | No |
var sys = dbDmvs | 2 | 0.10 % | No |
new Databasenew CTestmdf var | 2 | 0.10 % | No |
var col in columns | 2 | 0.10 % | No |
col in columns ConsoleWriteLinecolName | 2 | 0.10 % | No |
prefer the more SQLesque | 1 | 0.05 % | No |
can of course do | 1 | 0.05 % | No |
columns = from c in | 1 | 0.05 % | No |
var columns = from c | 1 | 0.05 % | No |
dbDmvs var columns = from | 1 | 0.05 % | No |
= dbDmvs var columns | 1 | 0.05 % | No |
well using var db | 1 | 0.05 % | No |
as well using var | 1 | 0.05 % | No |
Internal links in - improve.dk
About Me | Mark S. Rasmussen
Misc | Mark S. Rasmussen
Miscellaneous | Mark S. Rasmussen
Migrating from Wordpress to Hexo | Mark S. Rasmussen
SQL Server Mirroring - A Practical Approach | Mark S. Rasmussen
SQL Server Corruption Recovery - When All Else Fails | Mark S. Rasmussen
Corrupting Databases on Purpose Using the OrcaMDF Corruptor | Mark S. Rasmussen
OrcaMDF RawDatabase - A Swiss Army Knife for MDF Files | Mark S. Rasmussen
Introducing OrcaMDF | Mark S. Rasmussen
OrcaMDF Now Exposes Metadata Through System DMVs | Mark S. Rasmussen
OrcaMDF Studio Release + Feature Recap | Mark S. Rasmussen
Keeping Track of Time While Presenting | Mark S. Rasmussen
Mark S. Rasmussen
AS/Flex/Flash | Mark S. Rasmussen
IIS | Mark S. Rasmussen
Life | Mark S. Rasmussen
Performance | Mark S. Rasmussen
Testing | Mark S. Rasmussen
Umbraco | Mark S. Rasmussen
Web | Mark S. Rasmussen
Windbg | Mark S. Rasmussen
Windows | Mark S. Rasmussen
2009 | Mark S. Rasmussen
2008 | Mark S. Rasmussen
2007 | Mark S. Rasmussen
2006 | Mark S. Rasmussen
Improve.dk Spined HTML
OrcaMDF Now Exposes Metadata Through System DMVs | Mark S. Rasmussen Mark S. Rasmussen improve.dkWell-nighMe Pages Categories Archive Nov 10 2011 OrcaMDF Now Exposes Metadata Through System DMVs SQL Server - OrcaMDF Comments I’m sitting here on the train in Denmark, on the final leg home from SQLRally Nordic. During my presentation based on my OrcaMDF work, I implicitly spoken that OrcaMDF now exposes metadata – thougt I might as well share here as well. Other than expanding the cadre engine support in OrcaMDF, one of the main features I’ve wanted to implement was a way for OrcaMDF to expose metadata well-nigh your database. How do you list the tables, indexes, columns, etc. from your database? Avoiding false abstractions My initial thought was to create my own wresting layer on top of the objects. You could get the list of user tables by accessing the database.GetMetadata().UserTables enumeration, you’d get a list of tables, including columns, etc. This has a very wipe interface from the minutiae side, everything stuff normal .NET objects. However, it would moreover require me to come up with said wresting – and where do I yank the line on what to expose and what to alimony internal? What if my wresting didn’t finger natural to DBAs, stuff used to the sys.* DMVs from SQL Server? Exposing the seated DMVs from SQL Server I spent some time considering who might end up using OrcaMDF – and terminated there might be just well-nigh four persons in the world, and those four would be split evenly between DBA and SQL Server dev. Common for those is that they’re once used to navigating the metadata of SQL Server databses through system DMVs like sys.tables, sys.columns, sys.indexes etc. What then struck me was that I’m once worldly-wise to parse all of the wiring tables in SQL Server, and using OBJECT_DEFINITION, I can get the source lawmaking of the seated system DMVs. As such, it was a simple matter of creating my own replicas of the seated DMVs. How to use the DMVs in OrcaMDF Say we wanted to retrieve all the columns for a given data in SQL Server, we create a query like this: SELECT c.* FROM sys.columns c INNER JOIN sys.tables t ON c.object_id = t.object_id WHERE t.name = 'Persons' Doing the same in OrcaMDF could squint like this: using (var db = new Database(new[] { @"C:Test.mdf" })) { var sys = db.Dmvs; var table = sys.Tables.Where(t => t.Name == "Persons").Single(); var columns = sys.Columns.Where(c => c.ObjectID == table.ObjectID); foreach (var col in columns) Console.WriteLine(col.Name); } And if you prefer the increasingly SQL-esque syntax of LINQ, you can of undertow do it like this as well: using (var db = new Database(new[] { @"C:Test.mdf" })) { var sys = db.Dmvs; var columns = from c in sys.Columns join t in sys.Tables on c.ObjectID equals t.ObjectID where t.Name == "Persons" select c; foreach (var col in columns) Console.WriteLine(col.Name); } No matter how you segregate to do it, this is the result: What’s misogynist at this point If you grab the latest commit of OrcaMDF, you’ll have wangle to the pursuit DMVs, just as they’re exposed through SQL Server: sys.columns sys.indexes sys.index_columns sys.objects sys.objects$ sys.system_internals_allocation_units sys.system_internals_partitions sys.system_internals_partition_columns sys.tables sys.typesIncreasinglyis definitely on their way. Let me know if you have a special wish for a DMV – I might just be worldly-wise to make your wish come true! Mark S. Rasmussen I'm the CTO at iPaper where I petting with databases, mold lawmaking and maintain the overall technical & team responsibility. I'm an voracious speaker at user groups & conferences. I love life, motorcycles, photography and all things technical. Say hi on Twitter, write me an email or squint me up on LinkedIn. CATEGORIES .NETAS/Flex/FlashAmazon Web ServicesComputer ScienceConferences and PresentingIISLifeMiscMiscellaneousPerformancePokerSQL ServerSQL Server - CommunitySQL Server - Data TypesSQL Server - InternalsSQL Server - OptimizationSQL Server - OrcaMDFSQL Server - TricksTestingTools of the TradeUmbracoVisual StudioWebWindbgWindows ARCHIVE 201420132012201120102009200820072006 Copyright © 2014 Mark S. Rasmussen