SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE AWBuildVersion( SystemInformationID tinyint IDENTITY(1,1) NOT NULL, [Database Version] nvarchar(25) NOT NULL, VersionDate datetime NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_AWBuildVersion_SystemInformationID PRIMARY KEY CLUSTERED ( SystemInformationID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE DatabaseLog( DatabaseLogID int IDENTITY(1,1) NOT NULL, PostTime datetime NOT NULL, DatabaseUser sysname NOT NULL, Event sysname NOT NULL, [Schema] sysname NULL, Object sysname NULL, TSQL nvarchar(max) NOT NULL, XmlEvent xml NOT NULL, CONSTRAINT PK_DatabaseLog_DatabaseLogID PRIMARY KEY NONCLUSTERED ( DatabaseLogID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE ErrorLog( ErrorLogID int IDENTITY(1,1) NOT NULL, ErrorTime datetime NOT NULL, UserName varchar(30) NOT NULL, ErrorNumber int NOT NULL, ErrorSeverity int NULL, ErrorState int NULL, ErrorProcedure nvarchar(126) NULL, ErrorLine int NULL, ErrorMessage nvarchar(4000) NOT NULL, CONSTRAINT PK_ErrorLog_ErrorLogID PRIMARY KEY CLUSTERED ( ErrorLogID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Department( DepartmentID smallint IDENTITY(1,1) NOT NULL, Name VARCHAR(50) NOT NULL, GroupName VARCHAR(50) NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Department_DepartmentID PRIMARY KEY CLUSTERED ( DepartmentID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Employee( BusinessEntityID int NOT NULL, NationalIDNumber nvarchar(15) NOT NULL, LoginID nvarchar(256) NOT NULL, OrganizationNode hierarchyid NULL, OrganizationLevel AS (OrganizationNode.GetLevel()), JobTitle nvarchar(50) NOT NULL, BirthDate datetime NOT NULL, MaritalStatus nchar(1) NOT NULL, Gender nchar(1) NOT NULL, HireDate date NOT NULL, SalariedFlag bit NOT NULL, VacationHours smallint NOT NULL, SickLeaveHours smallint NOT NULL, CurrentFlag bit NOT NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Employee_BusinessEntityID PRIMARY KEY CLUSTERED ( BusinessEntityID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE EmployeeDepartmentHistory( BusinessEntityID int NOT NULL, DepartmentID smallint NOT NULL, ShiftID tinyint NOT NULL, StartDate date NOT NULL, EndDate date NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_EmployeeDepartmentHistory_BusinessEntityID_StartDate_DepartmentID PRIMARY KEY CLUSTERED ( BusinessEntityID ASC, StartDate ASC, DepartmentID ASC, ShiftID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE EmployeePayHistory( BusinessEntityID int NOT NULL, RateChangeDate datetime NOT NULL, Rate money NOT NULL, PayFrequency tinyint NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_EmployeePayHistory_BusinessEntityID_RateChangeDate PRIMARY KEY CLUSTERED ( BusinessEntityID ASC, RateChangeDate ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE JobCandidate( JobCandidateID int IDENTITY(1,1) NOT NULL, BusinessEntityID int NULL, Resume xml(CONTENT HRResumeSchemaCollection) NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_JobCandidate_JobCandidateID PRIMARY KEY CLUSTERED ( JobCandidateID ASC ) ) TEXTIMAGE_ON PRIMARY GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Shift( ShiftID int IDENTITY(1,1) NOT NULL, Name VARCHAR NOT NULL, StartTime datetime NOT NULL, EndTime datetime NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Shift_ShiftID PRIMARY KEY CLUSTERED ( ShiftID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE SCHEMA Production; GO CREATE TABLE Production.BillOfMaterials( BillOfMaterialsID int IDENTITY(1,1) NOT NULL, ProductAssemblyID int NULL, ComponentID int NOT NULL, StartDate datetime NOT NULL, EndDate datetime NULL, UnitMeasureCode nchar(3) NOT NULL, BOMLevel int NOT NULL, PerAssemblyQty decimal(8, 2) NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_BillOfMaterials_BillOfMaterialsID PRIMARY KEY NONCLUSTERED ( BillOfMaterialsID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.Document( DocumentNode hierarchyid NOT NULL, DocumentLevel AS (DocumentNode.GetLevel()), Title nvarchar(50) NOT NULL, Owner varchar(30) NOT NULL, FolderFlag int NOT NULL, FileName nvarchar(400) NOT NULL, FileExtension nvarchar(8) NOT NULL, Revision nvarchar(5) NOT NULL, ChangeNumber int NOT NULL, Status int NOT NULL, DocumentSummary nvarchar(max) NULL, Document varchar(max) NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Document_DocumentNode PRIMARY KEY CLUSTERED ( DocumentNode ASC ), UNIQUE NONCLUSTERED ( rowguid ASC ) TEXTIMAGE_ON PRIMARY GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.Illustration( IllustrationID int IDENTITY NOT NULL, Diagram xml NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Illustration_IllustrationID PRIMARY KEY CLUSTERED ( IllustrationID ASC ) TEXTIMAGE_ON PRIMARY GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.Location( LocationID smallint IDENTITY(1,1) NOT NULL, Name varchar(40) NOT NULL, CostRate decimal NOT NULL, Availability decimal NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Location_LocationID PRIMARY KEY CLUSTERED ( LocationID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.Product( ProductID int IDENTITY(1,1) NOT NULL, Name Varchar(40) NOT NULL, ProductNumber nvarchar(25) NOT NULL, MakeFlag int NOT NULL, FinishedGoodsFlag int NOT NULL, Color nvarchar(15) NULL, SafetyStockLevel smallint NOT NULL, ReorderPoint smallint NOT NULL, StandardCost money NOT NULL, ListPrice money NOT NULL, Size nvarchar(5) NULL, SizeUnitMeasureCode nchar(3) NULL, WeightUnitMeasureCode nchar(3) NULL, Weight decimal(8, 2) NULL, DaysToManufacture int NOT NULL, ProductLine nchar(2) NULL, Class nchar(2) NULL, Style nchar(2) NULL, ProductSubcategoryID int NULL, ProductModelID int NULL, SellStartDate datetime NOT NULL, SellEndDate datetime NULL, DiscontinuedDate datetime NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_Product_ProductID PRIMARY KEY CLUSTERED ( ProductID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductCategory( ProductCategoryID int IDENTITY NOT NULL, Name VARCHAR(30) NOT NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductCategory_ProductCategoryID PRIMARY KEY CLUSTERED ( ProductCategoryID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductCostHistory( ProductID int NOT NULL, StartDate datetime NOT NULL, EndDate datetime NULL, StandardCost money NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductCostHistory_ProductID_StartDate PRIMARY KEY CLUSTERED ( ProductID ASC, StartDate ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductDescription( ProductDescriptionID int IDENTITY(1,1) NOT NULL, Description nvarchar(400) NOT NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductDescription_ProductDescriptionID PRIMARY KEY CLUSTERED ( ProductDescriptionID ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductDocument( ProductID int NOT NULL, DocumentNode hierarchyid NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductDocument_ProductID_DocumentNode PRIMARY KEY CLUSTERED ( ProductID ASC, DocumentNode ASC ) ) GO SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductInventory( ProductID int NOT NULL, LocationID smallint NOT NULL, Shelf nvarchar(10) NOT NULL, Bin tinyint NOT NULL, Quantity smallint NOT NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductInventory_ProductID_LocationID PRIMARY KEY CLUSTERED ( ProductID ASC, LocationID ASC ) ) GO /****** Object: Table Production.ProductListPriceHistory Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductListPriceHistory( ProductID int NOT NULL, StartDate datetime NOT NULL, EndDate datetime NULL, ListPrice money NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductListPriceHistory_ProductID_StartDate PRIMARY KEY CLUSTERED ( ProductID ASC, StartDate ASC ) ) GO /****** Object: Table Production.ProductModel Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductModel( ProductModelID int IDENTITY(1,1) NOT NULL, Name Name NOT NULL, CatalogDescription xml(CONTENT Production.ProductDescriptionSchemaCollection) NULL, Instructions xml(CONTENT Production.ManuInstructionsSchemaCollection) NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductModel_ProductModelID PRIMARY KEY CLUSTERED ( ProductModelID ASC ) TEXTIMAGE_ON PRIMARY GO /****** Object: Table Production.ProductModelIllustration Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductModelIllustration( ProductModelID int NOT NULL, IllustrationID int NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductModelIllustration_ProductModelID_IllustrationID PRIMARY KEY CLUSTERED ( ProductModelID ASC, IllustrationID ASC ) ) GO /****** Object: Table Production.ProductModelProductDescriptionCulture Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductModelProductDescriptionCulture( ProductModelID int NOT NULL, ProductDescriptionID int NOT NULL, CultureID nchar(6) NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductModelProductDescriptionCulture_ProductModelID_ProductDescriptionID_CultureID PRIMARY KEY CLUSTERED ( ProductModelID ASC, ProductDescriptionID ASC, CultureID ASC ) ) GO /****** Object: Table Production.ProductPhoto Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductPhoto( ProductPhotoID int IDENTITY(1,1) NOT NULL, ThumbNailPhoto varbinary(max) NULL, ThumbnailPhotoFileName nvarchar(50) NULL, LargePhoto varbinary(max) NULL, LargePhotoFileName nvarchar(50) NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductPhoto_ProductPhotoID PRIMARY KEY CLUSTERED ( ProductPhotoID ASC ) TEXTIMAGE_ON PRIMARY GO /****** Object: Table Production.ProductProductPhoto Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductProductPhoto( ProductID int NOT NULL, ProductPhotoID int NOT NULL, Flag int NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductProductPhoto_ProductID_ProductPhotoID PRIMARY KEY NONCLUSTERED ( ProductID ASC, ProductPhotoID ASC ) ) GO /****** Object: Table Production.ProductSubcategory Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ProductSubcategory( ProductSubcategoryID int IDENTITY(1,1) NOT NULL, ProductCategoryID int NOT NULL, Name varchar(40) NOT NULL, rowguid uniqueidentifier ROWGUIDCOL NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ProductSubcategory_ProductSubcategoryID PRIMARY KEY CLUSTERED ( ProductSubcategoryID ASC ) ) GO /****** Object: Table Production.ScrapReason Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.ScrapReason( ScrapReasonID smallint IDENTITY(1,1) NOT NULL, Name varchar(50) NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_ScrapReason_ScrapReasonID PRIMARY KEY CLUSTERED ( ScrapReasonID ASC ) ) GO /****** Object: Table Production.TransactionHistory Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.TransactionHistory( TransactionID int IDENTITY(100000,1) NOT NULL, ProductID int NOT NULL, ReferenceOrderID int NOT NULL, ReferenceOrderLineID int NOT NULL, TransactionDate datetime NOT NULL, TransactionType nchar(1) NOT NULL, Quantity int NOT NULL, ActualCost money NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_TransactionHistory_TransactionID PRIMARY KEY CLUSTERED ( TransactionID ASC ) ) GO /****** Object: Table Production.TransactionHistoryArchive Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.TransactionHistoryArchive( TransactionID int NOT NULL, ProductID int NOT NULL, ReferenceOrderID int NOT NULL, ReferenceOrderLineID int NOT NULL, TransactionDate datetime NOT NULL, TransactionType nchar(1) NOT NULL, Quantity int NOT NULL, ActualCost money NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_TransactionHistoryArchive_TransactionID PRIMARY KEY CLUSTERED ( TransactionID ASC ) ) GO /****** Object: Table Production.UnitMeasure Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.UnitMeasure( UnitMeasureCode nchar(3) NOT NULL, Name varchar(30) NOT NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_UnitMeasure_UnitMeasureCode PRIMARY KEY CLUSTERED ( UnitMeasureCode ASC ) ) GO /****** Object: Table Production.WorkOrder Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.WorkOrder( WorkOrderID int IDENTITY(1,1) NOT NULL, ProductID int NOT NULL, OrderQty int NOT NULL, StockedQty AS (isnull(OrderQty-ScrappedQty,(0))), ScrappedQty smallint NOT NULL, StartDate datetime NOT NULL, EndDate datetime NULL, DueDate datetime NOT NULL, ScrapReasonID smallint NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_WorkOrder_WorkOrderID PRIMARY KEY CLUSTERED ( WorkOrderID ASC ) ) GO /****** Object: Table Production.WorkOrderRouting Script Date: 1/21/2022 3:49:03 PM ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE Production.WorkOrderRouting( WorkOrderID int NOT NULL, ProductID int NOT NULL, OperationSequence smallint NOT NULL, LocationID smallint NOT NULL, ScheduledStartDate datetime NOT NULL, ScheduledEndDate datetime NOT NULL, ActualStartDate datetime NULL, ActualEndDate datetime NULL, ActualResourceHrs decimal(9, 4) NULL, PlannedCost money NOT NULL, ActualCost money NULL, ModifiedDate datetime NOT NULL, CONSTRAINT PK_WorkOrderRouting_WorkOrderID_ProductID_OperationSequence PRIMARY KEY CLUSTERED ( WorkOrderID ASC, ProductID ASC, OperationSequence ASC ) ) GO ALTER TABLE AWBuildVersion ADD CONSTRAINT DF_AWBuildVersion_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE ErrorLog ADD CONSTRAINT DF_ErrorLog_ErrorTime DEFAULT (getdate()) FOR ErrorTime GO ALTER TABLE Department ADD CONSTRAINT DF_Department_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Employee ADD CONSTRAINT DF_Employee_SalariedFlag DEFAULT ((1)) FOR SalariedFlag GO ALTER TABLE Employee ADD CONSTRAINT DF_Employee_VacationHours DEFAULT ((0)) FOR VacationHours GO ALTER TABLE Employee ADD CONSTRAINT DF_Employee_SickLeaveHours DEFAULT ((0)) FOR SickLeaveHours GO ALTER TABLE Employee ADD CONSTRAINT DF_Employee_CurrentFlag DEFAULT ((1)) FOR CurrentFlag GO ALTER TABLE Employee ADD CONSTRAINT DF_Employee_rowguid DEFAULT (newid()) FOR rowguid GO ALTER TABLE Employee ADD CONSTRAINT DF_Employee_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE EmployeeDepartmentHistory ADD CONSTRAINT DF_EmployeeDepartmentHistory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE EmployeePayHistory ADD CONSTRAINT DF_EmployeePayHistory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Shift ADD CONSTRAINT DF_Shift_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate ALTER TABLE Production.BillOfMaterials ADD CONSTRAINT DF_BillOfMaterials_StartDate DEFAULT (getdate()) FOR StartDate GO ALTER TABLE Production.BillOfMaterials ADD CONSTRAINT DF_BillOfMaterials_PerAssemblyQty DEFAULT ((1.00)) FOR PerAssemblyQty GO ALTER TABLE Production.BillOfMaterials ADD CONSTRAINT DF_BillOfMaterials_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.Location ADD CONSTRAINT DF_Location_CostRate DEFAULT ((0.00)) FOR CostRate GO ALTER TABLE Production.Location ADD CONSTRAINT DF_Location_Availability DEFAULT ((0.00)) FOR Availability GO ALTER TABLE Production.Location ADD CONSTRAINT DF_Location_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductCategory ADD CONSTRAINT DF_ProductCategory_rowguid DEFAULT (newid()) FOR rowguid GO ALTER TABLE Production.ProductCategory ADD CONSTRAINT DF_ProductCategory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductCostHistory ADD CONSTRAINT DF_ProductCostHistory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductDescription ADD CONSTRAINT DF_ProductDescription_rowguid DEFAULT (newid()) FOR rowguid GO ALTER TABLE Production.ProductDescription ADD CONSTRAINT DF_ProductDescription_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductDocument ADD CONSTRAINT DF_ProductDocument_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductInventory ADD CONSTRAINT DF_ProductInventory_Quantity DEFAULT ((0)) FOR Quantity GO ALTER TABLE Production.ProductInventory ADD CONSTRAINT DF_ProductInventory_rowguid DEFAULT (newid()) FOR rowguid GO ALTER TABLE Production.ProductInventory ADD CONSTRAINT DF_ProductInventory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductListPriceHistory ADD CONSTRAINT DF_ProductListPriceHistory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductModelIllustration ADD CONSTRAINT DF_ProductModelIllustration_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductModelProductDescriptionCulture ADD CONSTRAINT DF_ProductModelProductDescriptionCulture_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ProductSubcategory ADD CONSTRAINT DF_ProductSubcategory_rowguid DEFAULT (newid()) FOR rowguid GO ALTER TABLE Production.ProductSubcategory ADD CONSTRAINT DF_ProductSubcategory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.ScrapReason ADD CONSTRAINT DF_ScrapReason_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.TransactionHistory ADD CONSTRAINT DF_TransactionHistory_ReferenceOrderLineID DEFAULT ((0)) FOR ReferenceOrderLineID GO ALTER TABLE Production.TransactionHistory ADD CONSTRAINT DF_TransactionHistory_TransactionDate DEFAULT (getdate()) FOR TransactionDate GO ALTER TABLE Production.TransactionHistory ADD CONSTRAINT DF_TransactionHistory_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.TransactionHistoryArchive ADD CONSTRAINT DF_TransactionHistoryArchive_ReferenceOrderLineID DEFAULT ((0)) FOR ReferenceOrderLineID GO ALTER TABLE Production.TransactionHistoryArchive ADD CONSTRAINT DF_TransactionHistoryArchive_TransactionDate DEFAULT (getdate()) FOR TransactionDate GO ALTER TABLE Production.TransactionHistoryArchive ADD CONSTRAINT DF_TransactionHistoryArchive_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.UnitMeasure ADD CONSTRAINT DF_UnitMeasure_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.WorkOrder ADD CONSTRAINT DF_WorkOrder_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO ALTER TABLE Production.WorkOrderRouting ADD CONSTRAINT DF_WorkOrderRouting_ModifiedDate DEFAULT (getdate()) FOR ModifiedDate GO
Stuck with a problem? Got Error? Ask ChatGPT!
Copy Clear