首页 > 代码库 > 插入ID=-1 的数据
插入ID=-1 的数据
IF NOT EXISTS(SELECT * FROM [dbo].[T_OMS_Distributor] WHERE Id =-1)
BEGIN
SET IDENTITY_INSERT [dbo].[T_OMS_Distributor] ON
INSERT [dbo].[T_OMS_Distributor] ([Id], [OwnerId], [CreationDate], [ModifierId], [ModifiedDate], [IsActive], [OMS_DistributorRankId], [DistributorName], [DistributorFullName], [ContactorName], [Phone], [Mobile], [Fax], [Address], [Remark], [CompanyId]) VALUES (-1, N‘ecshow‘, CAST(0x0000A2E601145269 AS DateTime), N‘ecshow‘, CAST(0x0000A2E601145269 AS DateTime), 1, NULL, N‘总部‘, N‘总部‘, N‘‘, N‘‘, N‘1234rt678‘, N‘‘, N‘‘, N‘‘, -1)
SET IDENTITY_INSERT [dbo].[T_OMS_Distributor] OFF
END
GO
IF NOT EXISTS(SELECT * FROM dbo.T_OMS_DistributorAccountInfo WHERE Id =-1)
BEGIN
INSERT [dbo].[T_OMS_DistributorAccountInfo] ([Id], [Amount], [OccupyAmount], [FreezeAmount], [CreditAmount], [CompanyId]) VALUES (-1, CAST(0 AS Decimal(14, 4)), CAST(0.0000 AS Decimal(14, 4)), CAST(0.0000 AS Decimal(14, 4)), CAST(0.0000 AS Decimal(14, 4)), -1)
END
BEGIN
SET IDENTITY_INSERT [dbo].[T_OMS_Distributor] ON
INSERT [dbo].[T_OMS_Distributor] ([Id], [OwnerId], [CreationDate], [ModifierId], [ModifiedDate], [IsActive], [OMS_DistributorRankId], [DistributorName], [DistributorFullName], [ContactorName], [Phone], [Mobile], [Fax], [Address], [Remark], [CompanyId]) VALUES (-1, N‘ecshow‘, CAST(0x0000A2E601145269 AS DateTime), N‘ecshow‘, CAST(0x0000A2E601145269 AS DateTime), 1, NULL, N‘总部‘, N‘总部‘, N‘‘, N‘‘, N‘1234rt678‘, N‘‘, N‘‘, N‘‘, -1)
SET IDENTITY_INSERT [dbo].[T_OMS_Distributor] OFF
END
GO
IF NOT EXISTS(SELECT * FROM dbo.T_OMS_DistributorAccountInfo WHERE Id =-1)
BEGIN
INSERT [dbo].[T_OMS_DistributorAccountInfo] ([Id], [Amount], [OccupyAmount], [FreezeAmount], [CreditAmount], [CompanyId]) VALUES (-1, CAST(0 AS Decimal(14, 4)), CAST(0.0000 AS Decimal(14, 4)), CAST(0.0000 AS Decimal(14, 4)), CAST(0.0000 AS Decimal(14, 4)), -1)
END
http://www.cnblogs.com/kingjiong/archive/2010/02/08/1665949.html
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。