Wang 发布的文章

原因在于每个扇区的物理字节数。

使用以下命令可以查看:

fsutil fsinfo sectorinfo c:
LogicalBytesPerSector :                                 512
PhysicalBytesPerSectorForAtomicity :                    32768
PhysicalBytesPerSectorForPerformance :                  32768
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
设备校准 :                                        已校准(0x000)
设备上的分区校准:                                  已校准(0x000)
无搜寻惩罚
支持剪裁
不支持 DAX
未精简预配

这两个32768是导致sqlserver出错的原因。
解决方案就是执行以下命令:

reg add "HKLM\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device" /v "ForcedPhysicalSectorSizeInBytes" /t reg_multi_sz /d "* 4095" /f

重启之后再查看结果:

LogicalBytesPerSector :                                 512
PhysicalBytesPerSectorForAtomicity :                    4096
PhysicalBytesPerSectorForPerformance :                  4096
FileSystemEffectivePhysicalBytesPerSectorForAtomicity : 4096
设备校准 :                                        已校准(0x000)
设备上的分区校准:                                  已校准(0x000)
无搜寻惩罚
支持剪裁
不支持 DAX
未精简预配

详情

取消默认可查看任何数据库

DENY VIEW any DATABASE TO PUBLIC;

赋予自己拥有管理权限的数据库的查看权限

ALTER AUTHORIZATION ON DATABASE::[Database] TO [User];

注意:
如果数据库已存在用户权限,则可能要删除后再操作

  • 一般的ID、Name:

    new TableDaoRelationship(nameof(PayOrder.User), UserDAO.Instance.TableName)
  • 一般的ID、Name、Value:

    new TableDaoRelationship(nameof(PayOrder.Merchant), MerchantDAO.Instance.TableName).SetOtherFiledsAsIdNameValue(nameof(Merchant.Name), nameof(Merchant.MchId))
  • 一般的ID、Value:

    new TableDaoRelationship(nameof(PayOrder.ProfitSharingPlanOrder), ProfitSharingPlanOrderDAO.Instance.TableName).SetOtherFiledsAsIdValue(nameof(ProfitSharingPlanOrder.Status))
  • 主表ID和关联表ID
    重点在于:SetSelfFieldAlias

    new TableDaoRelationship(nameof(PayOrder.ID), PayOrderTransactionDAO.Instance.TableName).SetSelfFieldAlias(nameof(PayOrder.Transaction)).SetOtherFileds(typeof(PayOrderTransactionInfo))
  • 指定关联表别名
    一般用于查询时需要使用关联表栏位作为查询条件
    重点在于:SetOtherTableAlias,使用时在生成查询条件时要指定Field。

    new TableDaoRelationship(nameof(PayOrder.ID), PayOrderTransactionDAO.Instance.TableName).SetSelfFieldAlias(nameof(PayOrder.Transaction)).SetOtherTableAlias(nameof(SQMIS.Model.PayOrderTransaction)).SetOtherFileds(typeof(PayOrderTransactionInfo))
    .AppendEqual(new Field(nameof(SQMIS.Model.PayOrderTransaction), nameof(SQMIS.Model.PayOrderTransaction.TransactionId)), this.TransactionID)
  • 多重关联时使用SetMoreLogicExpressions,可使用self和other来代替两个表的别名:

    new TableDaoRelationship(nameof(User.Principal), "RBAC_UserPrincipal").SetOtherFiledsAsIdNameValue("Name", "OuterID").SetMoreLogicExpressions(LogicExpression.BuildEqual(new Field("self", "Type"), new Field("other", "Type")))

计算机配置->管理模板->网络->Lanman 工作站->双击右边的”启用不安全的来宾登录“,然后点击“已启用”

有可能是以下原因:

  • 打开本地组策略编辑器
  • 本地计算机 >> 计算机配置 >> 管理模版 >> Windows组件 >> 远程桌面服务 >> 远程桌面会话主机 >> 远程会话环境 >> 为远程桌面连接使用WDDM图形显示驱动程序,并将其值 设置为 禁用。