USE [NewDB]
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[trWOhead](
	[trwoid] [int] IDENTITY(1,1) NOT NULL,
	[wocode] [varchar](10) NOT NULL,
	[trcustomerid] [int] NOT NULL,
	[trsiteid] [int] NOT NULL,
	[wodesc] [varchar](1000) NOT NULL,
	[wocomments] [varchar](1000) NOT NULL,
	[closedate] [datetime] NULL,
	[completedby] [int] NOT NULL,
	[CompletedByName] [varchar](24) NOT NULL,
	[woprice] [money] NOT NULL,
	[wocost] [money] NOT NULL,
	[wotax] [money] NOT NULL,
	[updatedate] [datetime] NOT NULL,
	[createdate] [datetime] NOT NULL,
	[updatedby] [int] NOT NULL,
	[UpdatedByName] [varchar](24) NOT NULL,
PRIMARY KEY NONCLUSTERED 
(
	[trwoid] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_wocode]  DEFAULT ('') FOR [wocode]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_trcustomerid]  DEFAULT ((0)) FOR [trcustomerid]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_trsiteid]  DEFAULT ((0)) FOR [trsiteid]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_wodesc]  DEFAULT ('') FOR [wodesc]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_wocomments]  DEFAULT ('') FOR [wocomments]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_completedby]  DEFAULT ((0)) FOR [completedby]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_CompletedByName]  DEFAULT ('') FOR [CompletedByName]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_woprice]  DEFAULT ((0.00)) FOR [woprice]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_wocost]  DEFAULT ((0.00)) FOR [wocost]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_wotax]  DEFAULT ((0.00)) FOR [wotax]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_updatedate]  DEFAULT (getdate()) FOR [updatedate]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_createdate]  DEFAULT (getdate()) FOR [createdate]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_updatedby]  DEFAULT ((0)) FOR [updatedby]
GO

ALTER TABLE [dbo].[trWOhead] ADD  CONSTRAINT [DF_trWOhead_UpdatedByName]  DEFAULT ('') FOR [UpdatedByName]
GO


---
USE [NewDB]
GO
SET IDENTITY_INSERT [dbo].[trWOHead] ON 

INSERT [dbo].[trWOHead] ([trwoid], [wocode], [trcustomerid], [trsiteid], [wodesc], [wocomments], [closedate], [completedby], [CompletedByName], [woprice], [wocost], [wotax], [updatedate], [createdate], [updatedby], [UpdatedByName]) VALUES (1, 'ABCD', 20347, 0, 'descriptio', 'comments', NULL, 0, '', 0.0000, 0.0000, 0.0000, CAST('2021-03-09T05:54:32.970' AS DateTime), CAST('2021-03-09T05:54:32.970' AS DateTime), 0, '')
INSERT [dbo].[trWOHead] ([trwoid], [wocode], [trcustomerid], [trsiteid], [wodesc], [wocomments], [closedate], [completedby], [CompletedByName], [woprice], [wocost], [wotax], [updatedate], [createdate], [updatedby], [UpdatedByName]) VALUES (2, 'ABCD', 20347, 10105, 'not required', 'comments', NULL, 0, '', 0.0000, 0.0000, 0.0000, CAST('2021-03-10T18:32:21.167' AS DateTime), CAST('2021-03-10T18:32:21.167' AS DateTime), 0, '')
INSERT [dbo].[trWOHead] ([trwoid], [wocode], [trcustomerid], [trsiteid], [wodesc], [wocomments], [closedate], [completedby], [CompletedByName], [woprice], [wocost], [wotax], [updatedate], [createdate], [updatedby], [UpdatedByName]) VALUES (3, 'ABCD', 3101, 0, 'not required', 'comments', NULL, 0, '', 0.0000, 0.0000, 0.0000, CAST('2021-03-11T23:16:28.530' AS DateTime), CAST('2021-03-11T23:16:28.530' AS DateTime), 0, '')
INSERT [dbo].[trWOHead] ([trwoid], [wocode], [trcustomerid], [trsiteid], [wodesc], [wocomments], [closedate], [completedby], [CompletedByName], [woprice], [wocost], [wotax], [updatedate], [createdate], [updatedby], [UpdatedByName]) VALUES (4, 'ABCD', 3101, 0, 'not required', 'comments', NULL, 0, '', 0.0000, 0.0000, 0.0000, CAST('2021-03-12T01:17:36.643' AS DateTime), CAST('2021-03-12T01:17:36.643' AS DateTime), 0, '')
INSERT [dbo].[trWOHead] ([trwoid], [wocode], [trcustomerid], [trsiteid], [wodesc], [wocomments], [closedate], [completedby], [CompletedByName], [woprice], [wocost], [wotax], [updatedate], [createdate], [updatedby], [UpdatedByName]) VALUES (5, 'ABCD', 3101, 0, 'not required', 'comments', NULL, 0, '', 0.0000, 0.0000, 0.0000, CAST('2021-03-12T06:55:49.620' AS DateTime), CAST('2021-03-12T06:55:49.620' AS DateTime), 0, '')
INSERT [dbo].[trWOHead] ([trwoid], [wocode], [trcustomerid], [trsiteid], [wodesc], [wocomments], [closedate], [completedby], [CompletedByName], [woprice], [wocost], [wotax], [updatedate], [createdate], [updatedby], [UpdatedByName]) VALUES (6, 'ABCD', 3101, 0, 'not required', 'comments', NULL, 0, '', 0.0000, 0.0000, 0.0000, CAST('2021-03-16T00:20:55.590' AS DateTime), CAST('2021-03-16T00:20:55.590' AS DateTime), 0, '')
SET IDENTITY_INSERT [dbo].[trWOHead] OFF
GO


