Search code examples
visual-studiolinq-to-sqlsqlmetal

SQL Metal for specific tables or another way to refresh/add table to .dbml file


anybody have any easy way of doing this in Visual Studio, without having to use the Server Explorer ?

I tried also looking at macro's but recording only produce

  Sub TemporaryMacro()
  End Sub

So no luck there.

Any way to script this?


Solution

  • SqlMetal Include worked like a charm for me. First Create a complete dbml file using SqlMeta - Say testComplete.dbml

    Now provide this file as an input to SqlMetaInclude SqlMetalInclude /dbml:"testComplete.dbml" /output:"testSubSet.dbml" /include:dbo.SampleTable1=SampleTable1,dbo.SampleTable2=SampleTable2

    Note that this tool in has a GUI included which can handle the complete process.