What is SQL metal in LINQ?

SQL metal is a command line tool to generate code and mapping for LINQ to SQL. It automatically generates the entity classes for the given database. It is included in Windows SDK that is installed with Visual Studio.
Syntax for SQL metal at command prompt

sqlmetal [options] [<input file>]

To view the options list, type sqlmetal /? at command prompt. You can define various options such as Connection Options, Extraction options, and Output options. Input file might be SQL Server .mdf file, .sdf file, or a .dbml intermediate file.
It perform the following actions:

  1. Generate source code and mapping attributes or a mapping file from a database.
  2. Generate an intermediate database markup language (.dbml) file for customization from a database.
  3. Generate code and mapping attributes or a mapping file from a .dbml file.
Tagged , . Bookmark the permalink.

Leave a Reply