Developer Tools

Convert CREATE TABLE scripts to C# classes

Paste a SQL Server CREATE TABLE script and instantly generate a clean C# model class with nullable type support and optional Entity Framework attributes.

转换器工作区

在左侧粘贴您的 SQL,在右侧获取干净的 C# 实体代码。

T-SQL 输入

CREATE TABLE

C# 实体输出

Entity Framework
支持的 SQL 类型 int, bigint, smallint, tinyint, bit, decimal, numeric, money, float, real, date, datetime, datetime2, time, uniqueidentifier, nvarchar, varchar, nchar, char, text, ntext 等等。
主键检测 支持内联 (Inline) 主键和常见的表级主键定义。
最佳结果 粘贴完整的 CREATE TABLE 语句,包括 Schema、可空性和长度。

CREATE TABLE to C# Class Converter

此页面专为希望获得具有快速转换、可读输出和实用的面向 Entity Framework 选项的在线 create table to csharp 工作流的开发者而构建。

  • Convert SQL Server CREATE TABLE scripts into C# model classes
  • Generate properties from SQL column names and data types
  • Map nullable columns to nullable C# reference and value types
  • Optionally include [Table], [Column], [Key] and [MaxLength] attributes
常见问题

常见问题解答

Can I convert a CREATE TABLE script to a C# class?

Yes. Paste a SQL Server CREATE TABLE script and the tool generates a clean C# class from the table structure.

Does it support SQL Server data types?

Yes. Common SQL Server types such as int, bigint, decimal, bit, datetime, uniqueidentifier, varchar and nvarchar are mapped to suitable C# types.

Can it generate Entity Framework attributes?

Yes. You can enable attributes such as [Table], [Column], [Key] and [MaxLength] depending on your preferred output style.