SQL Server? ?????? ????? ???? ???? ??
???? ??? SQL Server ??? ???? ???? ??? ???? ??? ? ????. ORM. ? ??? ??? ???? ?? ??? ??? ???? ??? ??? ?????.
??:
- ??? ?? ??: ?? ???? ??? ?? ?? @TableName? ?????.
- ??? ?? ??: ??? ??? ???? ?? ???? ??? ??? ???? @Result ???? ?????.
- ? ??: ? ?? ??(??, ??? ??, null ?? ??) sys.columns ? sys.types ??? ????? ??? object_id? ???? table.
- ??? ?? ??: ? ?? ?? ??? ?? ??? @Result? ?????. ???? ? ??, ??? ?? ? ?? Null ?? ???? ?? ??? Null ?? ??(?)? ?????. ??? ??? ???? ?? C#? ???? ???? ?????.
- ??? ?? ??: ?? ??? ??? ??? ???? ?? ??? ?????. ?? ??? ???? ???? ????? C# ???? ?????.
?:
"Name" ?? ?? "Person"??? ???? ??? ???( ???) ? "Phone"(null ??) ???):
declare @TableName sysname = 'Person' declare @Result varchar(max) = 'public class ' + @TableName + ' {' select @Result = @Result + ' public ' + ColumnType + NullableSign + ' ' + ColumnName + ' { get; set; } ' from ( select replace(col.name, ' ', '_') ColumnName, column_id ColumnId, case typ.name when 'varchar' then 'string' else 'UNKNOWN_' + typ.name end ColumnType, case when col.is_nullable = 1 and typ.name = 'varchar' then '?' else '' end NullableSign from sys.columns col join sys.types typ on col.system_type_id = typ.system_type_id AND col.user_type_id = typ.user_type_id where object_id = object_id(@TableName) ) t order by ColumnId set @Result = @Result + ' }' print @Result
??:
public class Person { public string Name { get; set; } public string? Phone { get; set; } }
? ??? SQL Server ????? ????? ???? C# ???? ???? ??? ??????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

MySQL?? NULL ?? ?? ? ? 1. ???? ?? ? ? ? ??? NotNull? ???? ?? ??? NULL? ?????. 2. iSnull ?? ISNOTNULL = ??! =; 3. Ifnull ?? Coalesce ??? ????? ???? ???? ? ??? ? ????. 4. ?? ?? ????? NULL ?? ?? ??? ?? ???? ??? ?? ? ORM ??? ?? ?? ?????? ??????. NULL? ???? ?? ?? ???? ??? ???? ?? ?? ?? ????. ??? ???? ??, ?? ? ???? ?? ? ??? ?? ??? ??? ?? ???????. ??? ??? ???? ??? ?? ?? ??? ????? ?? ? ????.

MySQLDump? MySQL ??????? ??? ??? ???? ???? ?????. ??????? ???? ?? ?? ? ?? ?? ???? SQL ??? ?????. 1. ?? ??? ????? ??? ?????? ??? ???? ??? SQL ???? ?????. 2. ??? ?????? ?? ??? ??? ???? TB ?? ???? ?? ???? ???? ????. 3. ???? ???-single transaction,-databases,-all-databases,-routines ?; 4. MySQL ??? ???? ?? ?? ?? ?? ?? ? ??? ?? ??? ???? ? ????. 5. ??? ????? ????? ?? ? ?? ??? ???? ?? ????.

MySQL ?????? ? ???? ??? ??? information_schema? ?? ????? ?? ? ??? ??? ? ????. 1. ?? ?????? ?? ?? : SQL ?? ???? selecttable_schemaas'database ', sum (data_length index_length)/1024/1024as'size (mb) 'frominformation_schema.tablessgroupbytable_schema; ?? ??????? ? ??? ??? ?? ??????? ???? ??? ?? ? ? ????. 2. ?? ??? ??? ?????? : selectta? ??????

?? ?? ? ?? ?? ??? ??? ??? ?????? ?? ??? ??? ?????? ??? ?????? ?????? ??? ?????. ? ?? ?? ???? ????. ??, ??????, ??? ? ??? ?? ??? UTF8MB4? ???? ???? ShowCreatedAtabase/Table? ???? ? Alter ??? ??????. ??, ?????? ??? ? UTF8MB4 ?? ??? ???? ?? ?? ??? ????? SetNames? ??????. ??, ?? ??? ????? ???? UTF8MB4_UNICODE_CI? ???? ?? ? ????? ???? ???? ?????? ???? ?? ? ? ?? ?? ??? ????? ??????.

GroupBy? ???? ???? ????? ?? ??? ???? ? ???? ??? ? ??? ????? ? ?????. ?? ??, GroupByCustomer_ID? ???? ? ??? ? ???? ??? ? ????. ???? ? 1,000 ? ??? ? ??? ??? ?? ? ? ????. ?? ? ? ?? ??? GroupBy? ??????, ?? ?? ?? ???? ???? ??? ??? ? ? ????. ???? ???? ? ??? ? ??, ?? ?? ??? ? ?? ???? ???? ?????.

MySQL? ???? ??? ???? InnoDB ?? ??? ???? ??? ???? ???? ?????. 1. ????? ??? SQL ?? ????, ?? ?? ?? ?? ??? ?????. 2. ? ???? ???, ???, ?? ? ???? ?????. 3. ????? ???? ????? ??? STARTTRANSACTION, CONMING ? ROLLBACK???. 4. 4 ?? ?? ???? ?? ??, ?? ? ??, ?? ??? ?? ? ???? ?????. 5. ????? ???? ???? ?? ??? ??? ?? ??? ?? ?? ? ??? ????? ??????. ??? ????? ?? MySQL? ?? ???? ?? ??? ?? ? ? ????.

MySQL ??????? ???? ?? ???? ??? ?? ? ?????? ???? ????. ?? MySQL -U ??? ?? -P? ???? ????? ???? ???? ??? ?????? ??????. ?? ??????? ???? ?? ??? ??? ????? -h ?? ??? ???????. ??, mysql-u username-p database name ?? mysql-u username-p database name? ?? ??? ? ? ?? ??????? ?? ????? ??? ? ? SQL ??? ??? ? ????.

MySQL? ?? ?? ? ???? ?? ??? ??? ??, ?? ?? ? ???? ??? ??? ? ?????. ??, ??? ??? UTF8MB4? ?? ?? ??? ?? ??? ?????. ?? ??? UTF8MB4_UNICODE_CI? ?? ?? ?? ??? ???? UTF8MB4_BIN? ?? ?????. ??, ?? ??? ?? ??? ??, ??????, ??? ? ??? ??? ? ????. ??? ??? ?? UTF8MB4 ? UTF8MB4_UNICODE_CI? ?? ? ???? ???? ?? ????. ??, ?? ??? ?? ??? ?? ???? ?? ??, ?? ?? ???? ??? ??? ?? ???? ???? ??? ???? ???? ???????. ?? ?? ??? ???? ?? ???? ? ??? ? ?? ??? ???????.
