查看内容

更新7万条数据只用两秒的存储过程

  • 2020-01-05 06:52
  • 新浦京操作系统
  • Views

GO
/****** 对象:  Table [dbo].[OrderDetail] ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[OrderDetail](
 [ID] [int] IDENTITY(1,1) NOT NULL,
 [Guid] [uniqueidentifier] NOT NULL,
 [OrderGuid] [uniqueidentifier] NOT NULL,
 [DesignType] [int] NULL CONSTRAINT [DF_OrderDetail_DesignType]  DEFAULT ((1)),
 [POPOnlyCode] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
 [POPCode] [nvarchar](50) COLLATE Chinese_PRC_CI_AS NULL,
 [POPName] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
 [POPType] [新浦京澳门官网,nvarchar](100) COLLATE Chinese_PRC_CI_AS NOT NULL,
 [PointLocation] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
 [MakeContent] [nvarchar]新浦京棋牌手机版下载,(500) COLLATE Chinese_PRC_CI_AS NULL,
 [NetSizeWidth] [int] NOT NULL CONSTRAINT [DF__OrderDeta__NetSi__3587F3E0]  DEFAULT ((0)),
 [NetSizelength] [int] NOT NULL CONSTRAINT [DF__OrderDeta__NetSi__367C1819]  DEFAULT ((0)),
 [BleedWidth] [int] NOT NULL CONSTRAINT [DF__OrderDeta__Bleed__37703C52]  DEFAULT ((0)),
 [BleedLength] [int] NOT NULL CONSTRAINT [DF__OrderDeta__Bleed__3864608B]  DEFAULT ((0)),
 [BalanceWidth] [int] NOT NULL CONSTRAINT [DF__OrderDeta__Balan__395884C4]  DEFAULT ((0)),
 [BalanceLength] [int] NOT NULL CONSTRAINT [DF__OrderDeta__Balan__3A4CA8FD]  DEFAULT ((0)),
 [Amount] [int] NOT NULL CONSTRAINT [DF__OrderDeta__Amoun__3B40CD36]  DEFAULT ((1)),
 [EquipmentNameGuid] [uniqueidentifier] NULL,
 [EquipmentCurveGuid] [uniqueidentifier] NULL,
 [MakeDemand] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NOT NULL,
 [Schedule] [nvarchar](100) COLLATE Chinese_PRC_CI_AS NULL,
 [Outsourcing] [uniqueidentifier] NULL,
 [HelpGuid] [uniqueidentifier] NULL,
 [ShippingDepartmentGuid] [uniqueidentifier] NULL,
 [SizeArea] [decimal](18, 4) NOT NULL CONSTRAINT [DF__OrderDeta__SizeA__3C34F16F]  DEFAULT ((0)),
 [BleedArea] [decimal](18, 4) NOT NULL CONSTRAINT [DF__OrderDeta__Bleed__3D2915A8]  DEFAULT ((0)),
 [settlementArea] [decimal](18, 4) NOT NULL CONSTRAINT [DF__OrderDeta__settl__3E1D39E1]  DEFAULT ((0)),
 [SettlementAmount] [decimal](18, 4) NOT NULL CONSTRAINT [DF__OrderDeta__Settl__3F115E1A]  DEFAULT ((0.00)),
 [PriceUnit] [decimal](18, 4) NULL CONSTRAINT [DF_OrderDetail_PriceUnit]  DEFAULT ((0)),
 [PriceSum] [decimal](18, 4) NULL,
 [Remarks] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
 [Status] [bit] NOT NULL CONSTRAINT [DF_OrderDetail_Status]  DEFAULT ((1)),
 [AddData] [datetime] NOT NULL CONSTRAINT [DF_OrderDetail_AddData]  DEFAULT (getdate()),
 [UpdateData] [datetime] NOT NULL CONSTRAINT [DF_OrderDetail_UpdateData]  DEFAULT (getdate()),
 [ExtendInt1] [int] NULL,
 [ExtendInt2] [int] NULL,
 [ExtendInt3] [int] NULL,
 [ExtendString1] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
 [ExtendString2] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL,
 [ExtendString3] [nvarchar](500) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]

无限分类是一个老生常谈的话题了,网上有很多解决方案,可以分成二个流派,一种利用递归,一种利用非递归(当然需要其它一些辅助手段判断节点层次),但核心表结构都差不多,有三个关键字段(ID主键,ParentId上级类id,ClassName类名--理论上讲,如果用递归,这三个字段就足够了),完整表结构如下

上一篇:ORACLE 12C PDB 维护基础知识介绍 下一篇:没有了