SqlMetal命令帮助
2008-10-05 12:08
211 查看
SqlMetal [options] [<input file>]
Generates code and mapping for the LINQ to SQL component of the .NET framework. SqlMetal can:
- Generate source code and mapping attributes or a mapping file from a database.
- Generate an intermediate dbml file for customization from the database.
- Generate code and mapping attributes or mapping file from a dbml file.
Options:
/server:<name> Database server name.
/database:<name> Database catalog on server.
/user:<name> Login user ID (default: use Windows Authentication).
/password:<password> Login password (default: use Windows Authentication).
/conn:<connection string> Database connection string. Cannot be used with /server, /database, /user or /password options.
/timeout:<seconds> Timeout value to use when SqlMetal accesses the database (default: 0 which means infinite).
/views Extract database views.
/functions Extract database functions.
/sprocs Extract stored procedures.
/dbml[:file] Output as dbml. Cannot be used with /map option.
/code[:file] Output as source code. Cannot be used with /dbml option.
/map[:file] Generate mapping file, not attributes. Cannot be used with /dbml option.
/language:<language> Language for source code: VB or C# (default: derived from extension on code file name).
/namespace:<name> Namespace of generated code (default: no namespace).
/context:<type> Name of data context class (default: derived from database name).
/entitybase:<type> Base class of entity classes in the generated code (default: entities have no base class).
/pluralize Automatically pluralize or singularize class and member names using English language rules.
/serialization:<option> Generate serializable classes: None or Unidirectional (default: None).
/provider:<type> Provider type: SQLCompact, SQL2000, SQL2005, or SQL2008. (default: provider is determined at run time).
<input file> May be a SqlExpress mdf file, a SqlCE sdf file, or a dbml intermediate file.
Create code from SqlServer:
SqlMetal /server:myserver /database:northwind /code:nwind.cs /namespace:nwind
Generate intermediate dbml file from SqlServer:
SqlMetal /server:myserver /database:northwind /dbml:northwind.dbml /namespace:nwind
Generate code with external mapping from dbml:
SqlMetal /code:nwind.cs /map:nwind.map northwind.dbml
Generate dbml from a SqlCE sdf file:
SqlMetal /dbml:northwind.dbml northwind.sdf
Generate dbml from SqlExpress local server:
SqlMetal /server:./sqlexpress /database:northwind /dbml:northwind.dbml
Generate dbml by using a connection string in the command line:
SqlMetal /conn:"server='myserver'; database='northwind'" /dbml:northwind.dbml
SqlMetal [可选的选项][输入文件名称]
为.NET framework 的LINQ to SQL组件生成代码和映射。SqlMetal能够:
- 由数据库生成源代码和映射属性或者映射文件。
- 由数据库生成一个用于个性化(自定义)中介dbml文件。
- 由dbml文件生成源代码和映射属性或者映射文件。
选项:
/server:<name> 数据库服务器名称[可以是包括端口号在内的IP地址等]。
/database:<name> 数据库名称。
/user:<name> 登录数据库服务器用户名(默认情况下使用Windows认证方式)。
/password:<password> 登录数据库服务器密码(默认情况下使用Windows认证方式)。
/conn:<connection string> 数据库连接字符串。不能和/server, /database, /user, /password 选项一直使用。
/timeout:<second> 访问数据库的超时时间。(默认情况下为0,表示无穷大)
/views 解析出数据库视图。
/functions 解析出数据库函数[自定义函数?]。
/sprocs 解析出存储过程。
/dbml[:file] 以dbml方式输出。不能和/map 选项一起使用。
/code[:file] 以源代码方式输出。不能和/dbml选项一起使用。
/map[:file] 生成映射文件,而不是属性。不能和/dbml选项一起使用。
/language:<language> 源代码语言:VB 或者 C#(默认情况下由指定的源代码文件名称后缀得到)。
/namespace:<name> 生成代码的命名空间(默认情况下没有命名空间)。
/context:<type> Date Context 类的名称(默认情况下等于数据库名称)。
/entitybase:<type> 生成代码中所有实体类(Entity Classes)的基类(默认情况下没有基类)。
/pluralize 使用英文语法规则自动的添加复数或者单数的类和成员名称。
/serialization:<option> 生成可序列化类:None 或者 Unidirectional(默认情况下为None)。
/provider:<type> 提供者类型:SQLCompact,SQL2000,SQL2005,SQL2008(默认的提供者表示在运行时决定提供者类型)。
<input file> 可以是一个SQL Express MDF文件或者一个SQLCE SDF文件 或者一个 dbml中介文件。
Generates code and mapping for the LINQ to SQL component of the .NET framework. SqlMetal can:
- Generate source code and mapping attributes or a mapping file from a database.
- Generate an intermediate dbml file for customization from the database.
- Generate code and mapping attributes or mapping file from a dbml file.
Options:
/server:<name> Database server name.
/database:<name> Database catalog on server.
/user:<name> Login user ID (default: use Windows Authentication).
/password:<password> Login password (default: use Windows Authentication).
/conn:<connection string> Database connection string. Cannot be used with /server, /database, /user or /password options.
/timeout:<seconds> Timeout value to use when SqlMetal accesses the database (default: 0 which means infinite).
/views Extract database views.
/functions Extract database functions.
/sprocs Extract stored procedures.
/dbml[:file] Output as dbml. Cannot be used with /map option.
/code[:file] Output as source code. Cannot be used with /dbml option.
/map[:file] Generate mapping file, not attributes. Cannot be used with /dbml option.
/language:<language> Language for source code: VB or C# (default: derived from extension on code file name).
/namespace:<name> Namespace of generated code (default: no namespace).
/context:<type> Name of data context class (default: derived from database name).
/entitybase:<type> Base class of entity classes in the generated code (default: entities have no base class).
/pluralize Automatically pluralize or singularize class and member names using English language rules.
/serialization:<option> Generate serializable classes: None or Unidirectional (default: None).
/provider:<type> Provider type: SQLCompact, SQL2000, SQL2005, or SQL2008. (default: provider is determined at run time).
<input file> May be a SqlExpress mdf file, a SqlCE sdf file, or a dbml intermediate file.
Create code from SqlServer:
SqlMetal /server:myserver /database:northwind /code:nwind.cs /namespace:nwind
Generate intermediate dbml file from SqlServer:
SqlMetal /server:myserver /database:northwind /dbml:northwind.dbml /namespace:nwind
Generate code with external mapping from dbml:
SqlMetal /code:nwind.cs /map:nwind.map northwind.dbml
Generate dbml from a SqlCE sdf file:
SqlMetal /dbml:northwind.dbml northwind.sdf
Generate dbml from SqlExpress local server:
SqlMetal /server:./sqlexpress /database:northwind /dbml:northwind.dbml
Generate dbml by using a connection string in the command line:
SqlMetal /conn:"server='myserver'; database='northwind'" /dbml:northwind.dbml
SqlMetal [可选的选项][输入文件名称]
为.NET framework 的LINQ to SQL组件生成代码和映射。SqlMetal能够:
- 由数据库生成源代码和映射属性或者映射文件。
- 由数据库生成一个用于个性化(自定义)中介dbml文件。
- 由dbml文件生成源代码和映射属性或者映射文件。
选项:
/server:<name> 数据库服务器名称[可以是包括端口号在内的IP地址等]。
/database:<name> 数据库名称。
/user:<name> 登录数据库服务器用户名(默认情况下使用Windows认证方式)。
/password:<password> 登录数据库服务器密码(默认情况下使用Windows认证方式)。
/conn:<connection string> 数据库连接字符串。不能和/server, /database, /user, /password 选项一直使用。
/timeout:<second> 访问数据库的超时时间。(默认情况下为0,表示无穷大)
/views 解析出数据库视图。
/functions 解析出数据库函数[自定义函数?]。
/sprocs 解析出存储过程。
/dbml[:file] 以dbml方式输出。不能和/map 选项一起使用。
/code[:file] 以源代码方式输出。不能和/dbml选项一起使用。
/map[:file] 生成映射文件,而不是属性。不能和/dbml选项一起使用。
/language:<language> 源代码语言:VB 或者 C#(默认情况下由指定的源代码文件名称后缀得到)。
/namespace:<name> 生成代码的命名空间(默认情况下没有命名空间)。
/context:<type> Date Context 类的名称(默认情况下等于数据库名称)。
/entitybase:<type> 生成代码中所有实体类(Entity Classes)的基类(默认情况下没有基类)。
/pluralize 使用英文语法规则自动的添加复数或者单数的类和成员名称。
/serialization:<option> 生成可序列化类:None 或者 Unidirectional(默认情况下为None)。
/provider:<type> 提供者类型:SQLCompact,SQL2000,SQL2005,SQL2008(默认的提供者表示在运行时决定提供者类型)。
<input file> 可以是一个SQL Express MDF文件或者一个SQLCE SDF文件 或者一个 dbml中介文件。
相关文章推荐
- PostgreSQL 9.2.4所有命令的语法帮助及SQL语句简要说明
- oracle: 安装sqlplus help帮助命令
- 命令安装SQL*PLus 帮助手册(SP2-0171)
- 删除一个表的字段的sql语句命令
- 如何使用psql命令去调试含参的sql文件
- SQLServer中用T—SQL命令查询一个数据库中有哪些表的sql语句
- Microsoft SQL Server 管理 (常用管理及维护命令)
- SQL命令语句进行大数据查询如何进行优化
- SQL*PLUS命令使用大全
- SQL*plus中,使用上下键,调出历史命令
- shell调用sqlplus(sftp)并传入命令
- sql 的基本命令
- linux shell命令快捷获得系统帮助(一)[man-pages定义规范]
- Linux基础命令、及获取命令帮助信息
- Oracle基本使用----sql*plus常用命令
- [linux学习笔记]第2天:时间管理,命令帮助信息,文本查看,权限及用户管理,BASH和变量,脚本
- 构建对空表分配空间的SQL命令。
- 经典MSSQL语句大全和常用SQL语句命令的作用
- Oracle10g数据库体系结构的关键特性(sql命令查看)
- Linux 学习笔记(五) -----帮助命令及压缩与解压