Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
/* To prevent any potential data loss issues, you should review this script in detail before running it outside the context of the database designer.*/
BEGIN TRANSACTION
SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE TPrice.OrderDetails2
DROP CONSTRAINT FK_OrderDetails2_Products
GO
COMMIT
BEGIN TRANSACTION
GO
ALTER TABLE TPrice.OrderDetails2
DROP CONSTRAINT FK_OrderDetails2_Orders2
GO
COMMIT
BEGIN TRANSACTION
GO
CREATE TABLE TPrice.Tmp_OrderDetails2
(
OrderID int NOT NULL IDENTITY (1, 1),
ProductID int NOT NULL,
Quantity smallint NOT NULL
) ON [PRIMARY]
GO
SET IDENTITY_INSERT TPrice.Tmp_OrderDetails2 ON
GO
IF EXISTS(SELECT * FROM TPrice.OrderDetails2)
EXEC('INSERT INTO TPrice.Tmp_OrderDetails2 (OrderID, ProductID, Quantity)
SELECT OrderID, ProductID, Quantity FROM TPrice.OrderDetails2 WITH (HOLDLOCK TABLOCKX)')
GO
SET IDENTITY_INSERT TPrice.Tmp_OrderDetails2 OFF
GO
DROP TABLE TPrice.OrderDetails2
GO
EXECUTE sp_rename N'TPrice.Tmp_OrderDetails2', N'OrderDetails2', 'OBJECT'
GO
ALTER TABLE TPrice.OrderDetails2 ADD CONSTRAINT
PK_OrderDetails2 PRIMARY KEY CLUSTERED
(
OrderID,
ProductID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE TPrice.OrderDetails2 ADD CONSTRAINT
FK_OrderDetails2_Orders2 FOREIGN KEY
(
OrderID
) REFERENCES TPrice.Orders2
(
OrderID
) ON UPDATE NO ACTION
ON DELETE NO ACTION
GO
ALTER TABLE TPrice.OrderDetails2 ADD CONSTRAINT
FK_OrderDetails2_Products FOREIGN KEY
(
ProductID
) REFERENCES dbo.Products
(
ProductID
) ON UPDATE NO ACTION
ON DELETE NO ACTION
GO
COMMIT