ylbtech-范例-项目-.NET-PetShop-4.0-数据库设计:MSPetShop4 |
1. 数据关系图返回顶部 |
1、
2、
2. AspNet_SqlCacheTablesForChangeNotification 表与触发器返回顶部 |
1、AspNet_SqlCacheTablesForChangeNotication表数据
2、触发器
2.1、
USE [MSPetShop4]
GO
/****** Object: Trigger [dbo].[Category_AspNet_SqlCacheNotification_Trigger] Script Date: 2020/4/13 20:53:56 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Category_AspNet_SqlCacheNotification_Trigger] ON [dbo].[Category]
FOR INSERT, UPDATE, DELETE AS BEGIN
SET NOCOUNT ON
EXEC dbo.AspNet_SqlCacheUpdateChangeIdStoredProcedure N'Category'
END
2.2、
USE [MSPetShop4]
GO
/****** Object: Trigger [dbo].[Product_AspNet_SqlCacheNotification_Trigger] Script Date: 2020/4/13 21:04:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Product_AspNet_SqlCacheNotification_Trigger] ON [dbo].[Product]
FOR INSERT, UPDATE, DELETE AS BEGIN
SET NOCOUNT ON
EXEC dbo.AspNet_SqlCacheUpdateChangeIdStoredProcedure N'Product'
END
2.3、
USE [MSPetShop4]
GO
/****** Object: Trigger [dbo].[Item_AspNet_SqlCacheNotification_Trigger] Script Date: 2020/4/13 21:03:50 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER TRIGGER [dbo].[Item_AspNet_SqlCacheNotification_Trigger] ON [dbo].[Item]
FOR INSERT, UPDATE, DELETE AS BEGIN
SET NOCOUNT ON
EXEC dbo.AspNet_SqlCacheUpdateChangeIdStoredProcedure N'Item'
END
3、
3. 存储过程返回顶部 |
·AspNet_SqlCachePollingStoredProcedure
USE [MSPetShop4]
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCachePollingStoredProcedure] Script Date: 2020/4/13 21:06:23 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AspNet_SqlCachePollingStoredProcedure] AS
SELECT tableName, changeId FROM dbo.AspNet_SqlCacheTablesForChangeNotification
RETURN 0
·AspNet_SqlCacheQueryRegisteredTablesStoredProcedure
USE [MSPetShop4]
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheQueryRegisteredTablesStoredProcedure] Script Date: 2020/4/13 21:07:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AspNet_SqlCacheQueryRegisteredTablesStoredProcedure]
AS
SELECT tableName FROM dbo.AspNet_SqlCacheTablesForChangeNotification
·AspNet_SqlCacheRegisterTableStoredProcedure
USE [MSPetShop4]
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheRegisterTableStoredProcedure] Script Date: 2020/4/13 21:08:30 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AspNet_SqlCacheRegisterTableStoredProcedure]
@tableName NVARCHAR(450)
AS
BEGIN
DECLARE @triggerName AS NVARCHAR(3000)
DECLARE @fullTriggerName AS NVARCHAR(3000)
DECLARE @canonTableName NVARCHAR(3000)
DECLARE @quotedTableName NVARCHAR(3000)
/* Create the trigger name */
SET @triggerName = REPLACE(@tableName, '[', '__o__')
SET @triggerName = REPLACE(@triggerName, ']', '__c__')
SET @triggerName = @triggerName + '_AspNet_SqlCacheNotification_Trigger'
SET @fullTriggerName = 'dbo.[' + @triggerName + ']'
/* Create the cannonicalized table name for trigger creation */
/* Do not touch it if the name contains other delimiters */
IF (CHARINDEX('.', @tableName) <> 0 OR
CHARINDEX('[', @tableName) <> 0 OR
CHARINDEX(']', @tableName) <> 0)
SET @canonTableName = @tableName
ELSE
SET @canonTableName = '[' + @tableName + ']'
/* First make sure the table exists */
IF (SELECT OBJECT_ID(@tableName, 'U')) IS NULL
BEGIN
RAISERROR ('00000001', 16, 1)
RETURN
END
BEGIN TRAN
/* Insert the value into the notification table */
IF NOT EXISTS (SELECT tableName FROM dbo.AspNet_SqlCacheTablesForChangeNotification WITH (NOLOCK) WHERE tableName = @tableName)
IF NOT EXISTS (SELECT tableName FROM dbo.AspNet_SqlCacheTablesForChangeNotification WITH (TABLOCKX) WHERE tableName = @tableName)
INSERT dbo.AspNet_SqlCacheTablesForChangeNotification
VALUES (@tableName, GETDATE(), 0)
/* Create the trigger */
SET @quotedTableName = QUOTENAME(@tableName, '''')
IF NOT EXISTS (SELECT name FROM sysobjects WITH (NOLOCK) WHERE name = @triggerName AND type = 'TR')
IF NOT EXISTS (SELECT name FROM sysobjects WITH (TABLOCKX) WHERE name = @triggerName AND type = 'TR')
EXEC('CREATE TRIGGER ' + @fullTriggerName + ' ON ' + @canonTableName +'
FOR INSERT, UPDATE, DELETE AS BEGIN
SET NOCOUNT ON
EXEC dbo.AspNet_SqlCacheUpdateChangeIdStoredProcedure N' + @quotedTableName + '
END
')
COMMIT TRAN
END
·AspNet_SqlCacheUnRegisterTableStoredProcedure
USE [MSPetShop4]
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheUnRegisterTableStoredProcedure] Script Date: 2020/4/13 21:19:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AspNet_SqlCacheUnRegisterTableStoredProcedure]
@tableName NVARCHAR(450)
AS
BEGIN
BEGIN TRAN
DECLARE @triggerName AS NVARCHAR(3000)
DECLARE @fullTriggerName AS NVARCHAR(3000)
SET @triggerName = REPLACE(@tableName, '[', '__o__')
SET @triggerName = REPLACE(@triggerName, ']', '__c__')
SET @triggerName = @triggerName + '_AspNet_SqlCacheNotification_Trigger'
SET @fullTriggerName = 'dbo.[' + @triggerName + ']'
/* Remove the table-row from the notification table */
IF EXISTS (SELECT name FROM sysobjects WITH (NOLOCK) WHERE name = 'AspNet_SqlCacheTablesForChangeNotification' AND type = 'U')
IF EXISTS (SELECT name FROM sysobjects WITH (TABLOCKX) WHERE name = 'AspNet_SqlCacheTablesForChangeNotification' AND type = 'U')
DELETE FROM dbo.AspNet_SqlCacheTablesForChangeNotification WHERE tableName = @tableName
/* Remove the trigger */
IF EXISTS (SELECT name FROM sysobjects WITH (NOLOCK) WHERE name = @triggerName AND type = 'TR')
IF EXISTS (SELECT name FROM sysobjects WITH (TABLOCKX) WHERE name = @triggerName AND type = 'TR')
EXEC('DROP TRIGGER ' + @fullTriggerName)
COMMIT TRAN
END
··AspNet_SqlCacheUpdateChangeIdStoredProcedure
USE [MSPetShop4]
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheUpdateChangeIdStoredProcedure] Script Date: 2020/4/13 21:23:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[AspNet_SqlCacheUpdateChangeIdStoredProcedure]
@tableName NVARCHAR(450)
AS
BEGIN
UPDATE dbo.AspNet_SqlCacheTablesForChangeNotification WITH (ROWLOCK) SET changeId = changeId + 1
WHERE tableName = @tableName
END
·
4.返回顶部 |
1、
USE [master]
GO
/****** Object: Database [MSPetShop4] Script Date: 2020/4/13 20:44:07 ******/
CREATE DATABASE [MSPetShop4]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'MSPetShop4', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\MSPetShop4.mdf' , SIZE = 4288KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'MSPetShop4_log', FILENAME = N'C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\DATA\MSPetShop4_log.ldf' , SIZE = 1072KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [MSPetShop4] SET COMPATIBILITY_LEVEL = 120
GO
IF (1 = FULLTEXTSERVICEPROPERTY('IsFullTextInstalled'))
begin
EXEC [MSPetShop4].[dbo].[sp_fulltext_database] @action = 'enable'
end
GO
ALTER DATABASE [MSPetShop4] SET ANSI_NULL_DEFAULT OFF
GO
ALTER DATABASE [MSPetShop4] SET ANSI_NULLS OFF
GO
ALTER DATABASE [MSPetShop4] SET ANSI_PADDING OFF
GO
ALTER DATABASE [MSPetShop4] SET ANSI_WARNINGS OFF
GO
ALTER DATABASE [MSPetShop4] SET ARITHABORT OFF
GO
ALTER DATABASE [MSPetShop4] SET AUTO_CLOSE OFF
GO
ALTER DATABASE [MSPetShop4] SET AUTO_SHRINK OFF
GO
ALTER DATABASE [MSPetShop4] SET AUTO_UPDATE_STATISTICS ON
GO
ALTER DATABASE [MSPetShop4] SET CURSOR_CLOSE_ON_COMMIT OFF
GO
ALTER DATABASE [MSPetShop4] SET CURSOR_DEFAULT GLOBAL
GO
ALTER DATABASE [MSPetShop4] SET CONCAT_NULL_YIELDS_NULL OFF
GO
ALTER DATABASE [MSPetShop4] SET NUMERIC_ROUNDABORT OFF
GO
ALTER DATABASE [MSPetShop4] SET QUOTED_IDENTIFIER OFF
GO
ALTER DATABASE [MSPetShop4] SET RECURSIVE_TRIGGERS OFF
GO
ALTER DATABASE [MSPetShop4] SET ENABLE_BROKER
GO
ALTER DATABASE [MSPetShop4] SET AUTO_UPDATE_STATISTICS_ASYNC OFF
GO
ALTER DATABASE [MSPetShop4] SET DATE_CORRELATION_OPTIMIZATION OFF
GO
ALTER DATABASE [MSPetShop4] SET TRUSTWORTHY OFF
GO
ALTER DATABASE [MSPetShop4] SET ALLOW_SNAPSHOT_ISOLATION OFF
GO
ALTER DATABASE [MSPetShop4] SET PARAMETERIZATION SIMPLE
GO
ALTER DATABASE [MSPetShop4] SET READ_COMMITTED_SNAPSHOT OFF
GO
ALTER DATABASE [MSPetShop4] SET HONOR_BROKER_PRIORITY OFF
GO
ALTER DATABASE [MSPetShop4] SET RECOVERY FULL
GO
ALTER DATABASE [MSPetShop4] SET MULTI_USER
GO
ALTER DATABASE [MSPetShop4] SET PAGE_VERIFY CHECKSUM
GO
ALTER DATABASE [MSPetShop4] SET DB_CHAINING OFF
GO
ALTER DATABASE [MSPetShop4] SET FILESTREAM( NON_TRANSACTED_ACCESS = OFF )
GO
ALTER DATABASE [MSPetShop4] SET TARGET_RECOVERY_TIME = 0 SECONDS
GO
ALTER DATABASE [MSPetShop4] SET DELAYED_DURABILITY = DISABLED
GO
EXEC sys.sp_db_vardecimal_storage_format N'MSPetShop4', N'ON'
GO
USE [MSPetShop4]
GO
/****** Object: DatabaseRole [aspnet_ChangeNotification_ReceiveNotificationsOnlyAccess] Script Date: 2020/4/13 20:44:07 ******/
CREATE ROLE [aspnet_ChangeNotification_ReceiveNotificationsOnlyAccess]
GO
/****** Object: Schema [aspnet_ChangeNotification_ReceiveNotificationsOnlyAccess] Script Date: 2020/4/13 20:44:07 ******/
CREATE SCHEMA [aspnet_ChangeNotification_ReceiveNotificationsOnlyAccess]
GO
/****** Object: Table [dbo].[AspNet_SqlCacheTablesForChangeNotification] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[AspNet_SqlCacheTablesForChangeNotification](
[tableName] [nvarchar](450) NOT NULL,
[notificationCreated] [datetime] NOT NULL DEFAULT (getdate()),
[changeId] [int] NOT NULL DEFAULT ((0)),
PRIMARY KEY CLUSTERED
(
[tableName] 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
/****** Object: Table [dbo].[Category] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Category](
[CategoryId] [varchar](10) NOT NULL,
[Name] [varchar](80) NULL,
[Descn] [varchar](255) NULL,
PRIMARY KEY CLUSTERED
(
[CategoryId] 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
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Inventory] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Inventory](
[ItemId] [varchar](10) NOT NULL,
[Qty] [int] NOT NULL,
PRIMARY KEY CLUSTERED
(
[ItemId] 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
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Item] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Item](
[ItemId] [varchar](10) NOT NULL,
[ProductId] [varchar](10) NOT NULL,
[ListPrice] [decimal](10, 2) NULL,
[UnitCost] [decimal](10, 2) NULL,
[Supplier] [int] NULL,
[Status] [varchar](2) NULL,
[Name] [varchar](80) NULL,
[Image] [varchar](80) NULL,
PRIMARY KEY CLUSTERED
(
[ItemId] 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
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Product] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Product](
[ProductId] [varchar](10) NOT NULL,
[CategoryId] [varchar](10) NOT NULL,
[Name] [varchar](80) NULL,
[Descn] [varchar](255) NULL,
[Image] [varchar](80) NULL,
PRIMARY KEY CLUSTERED
(
[ProductId] 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
SET ANSI_PADDING OFF
GO
/****** Object: Table [dbo].[Supplier] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Supplier](
[SuppId] [int] NOT NULL,
[Name] [varchar](80) NULL,
[Status] [varchar](2) NOT NULL,
[Addr1] [varchar](80) NULL,
[Addr2] [varchar](80) NULL,
[City] [varchar](80) NULL,
[State] [varchar](80) NULL,
[Zip] [varchar](5) NULL,
[Phone] [varchar](40) NULL,
PRIMARY KEY CLUSTERED
(
[SuppId] 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
SET ANSI_PADDING OFF
GO
INSERT [dbo].[AspNet_SqlCacheTablesForChangeNotification] ([tableName], [notificationCreated], [changeId]) VALUES (N'Category', CAST(N'2020-04-08 21:40:35.807' AS DateTime), 5)
INSERT [dbo].[AspNet_SqlCacheTablesForChangeNotification] ([tableName], [notificationCreated], [changeId]) VALUES (N'Item', CAST(N'2020-04-08 21:40:35.813' AS DateTime), 82)
INSERT [dbo].[AspNet_SqlCacheTablesForChangeNotification] ([tableName], [notificationCreated], [changeId]) VALUES (N'Product', CAST(N'2020-04-08 21:40:35.810' AS DateTime), 31)
INSERT [dbo].[Category] ([CategoryId], [Name], [Descn]) VALUES (N'BIRDS', N'Birds', N'Birds')
INSERT [dbo].[Category] ([CategoryId], [Name], [Descn]) VALUES (N'BUGS', N'Bugs', N'Bugs')
INSERT [dbo].[Category] ([CategoryId], [Name], [Descn]) VALUES (N'BYARD', N'Backyard', N'Backyard')
INSERT [dbo].[Category] ([CategoryId], [Name], [Descn]) VALUES (N'EDANGER', N'Endangered', N'Endangered')
INSERT [dbo].[Category] ([CategoryId], [Name], [Descn]) VALUES (N'FISH', N'Fish', N'Fish')
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-1', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-10', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-11', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-12', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-13', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-14', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-15', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-16', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-17', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-18', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-19', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-2', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-20', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-21', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-22', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-23', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-24', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-25', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-26', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-27', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-28', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-29', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-3', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-30', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-31', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-32', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-33', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-34', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-35', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-36', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-37', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-38', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-39', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-4', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-40', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-41', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-42', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-43', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-44', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-45', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-46', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-47', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-48', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-49', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-5', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-50', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-51', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-52', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-53', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-54', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-55', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-56', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-57', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-58', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-59', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-6', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-60', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-61', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-62', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-63', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-64', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-65', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-66', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-67', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-68', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-69', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-7', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-70', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-71', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-72', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-73', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-74', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-75', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-76', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-77', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-78', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-79', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-8', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-80', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-81', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-82', 10000)
INSERT [dbo].[Inventory] ([ItemId], [Qty]) VALUES (N'EST-9', 10000)
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-1', N'FI-01', CAST(16.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Happy', N'~/Prod_Images/Fish/item-meno-happy.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-10', N'FI-04', CAST(18.50 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Tap Dance', N'~/Prod_Images/Fish/item-Crabfish-tabdance.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-11', N'FI-04', CAST(19.50 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Ballet', N'~/Prod_Images/Fish/item-Crabfish-ballet.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-12', N'FI-04', CAST(18.90 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Ballroom', N'~/Prod_Images/Fish/item-Crabfish-ballroom.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-13', N'FI-05', CAST(16.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Long Arms', N'~/Prod_Images/Fish/item-eucalyptus-longarms.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-14', N'FI-05', CAST(16.90 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Short Arms', N'~/Prod_Images/Fish/item-eucalyptus-shortarms.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-15', N'FI-06', CAST(13.90 AS Decimal(10, 2)), CAST(8.00 AS Decimal(10, 2)), 1, N'P', N'Black', N'~/Prod_Images/Fish/item-misterno-black.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-16', N'FI-06', CAST(14.50 AS Decimal(10, 2)), CAST(8.00 AS Decimal(10, 2)), 1, N'P', N'Sepia', N'~/Prod_Images/Fish/item-misterno-sepia.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-17', N'FI-06', CAST(15.50 AS Decimal(10, 2)), CAST(8.00 AS Decimal(10, 2)), 1, N'P', N'Sable', N'~/Prod_Images/Fish/item-misterno-sable.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-18', N'FI-07', CAST(16.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Invidious', N'~/Prod_Images/Fish/item-nosyfish-invidious.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-19', N'FI-07', CAST(17.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Beastly', N'~/Prod_Images/Fish/item-nosyfish-beastly.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-2', N'FI-01', CAST(17.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Camouflage', N'~/Prod_Images/Fish/item-meno-camouflage.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-20', N'FI-07', CAST(18.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Mean', N'~/Prod_Images/Fish/item-nosyfish-mean.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-21', N'FI-07', CAST(19.50 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Sneaky', N'~/Prod_Images/Fish/item-nosyfish-sneaky.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-22', N'FI-08', CAST(28.50 AS Decimal(10, 2)), CAST(20.00 AS Decimal(10, 2)), 1, N'P', N'Toothless', N'~/Prod_Images/Fish/item-toothferry-toothless.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-23', N'FI-08', CAST(29.50 AS Decimal(10, 2)), CAST(20.00 AS Decimal(10, 2)), 1, N'P', N'With Teeth', N'~/Prod_Images/Fish/item-toothferry-withteeth.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-24', N'BY-01', CAST(120.95 AS Decimal(10, 2)), CAST(99.00 AS Decimal(10, 2)), 1, N'P', N'Fuzzy', N'~/Prod_Images/Backyard/item-sheep-fuzzy.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-25', N'BY-01', CAST(130.95 AS Decimal(10, 2)), CAST(99.00 AS Decimal(10, 2)), 1, N'P', N'Ironed', N'~/Prod_Images/Backyard/item-sheep-ironed.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-26', N'BY-02', CAST(14.95 AS Decimal(10, 2)), CAST(2.00 AS Decimal(10, 2)), 1, N'P', N'Transparent', N'~/Prod_Images/Backyard/item-cat-transparent.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-27', N'BY-02', CAST(15.95 AS Decimal(10, 2)), CAST(2.00 AS Decimal(10, 2)), 1, N'P', N'Patterned', N'~/Prod_Images/Backyard/item-cat-patterned.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-28', N'BY-02', CAST(18.95 AS Decimal(10, 2)), CAST(2.00 AS Decimal(10, 2)), 1, N'P', N'Uncolored', N'~/Prod_Images/Backyard/item-cat-uncolored.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-29', N'BY-03', CAST(42.95 AS Decimal(10, 2)), CAST(30.00 AS Decimal(10, 2)), 1, N'P', N'Long Tongue', N'~/Prod_Images/Backyard/item-raccoon-long-tongue.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-3', N'FI-01', CAST(15.90 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Worried', N'~/Prod_Images/Fish/item-meno-worried.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-30', N'BY-03', CAST(45.95 AS Decimal(10, 2)), CAST(30.00 AS Decimal(10, 2)), 1, N'P', N'Rough Tongue', N'~/Prod_Images/Backyard/item-raccoon-rough-tongue.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-31', N'BY-03', CAST(48.95 AS Decimal(10, 2)), CAST(30.00 AS Decimal(10, 2)), 1, N'P', N'Hairy Tongue', N'~/Prod_Images/Backyard/item-raccoon-hairy-tongue.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-32', N'BY-04', CAST(20.95 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Feathered', N'~/Prod_Images/Backyard/item-goose-feathered.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-33', N'BY-04', CAST(22.95 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Plucked', N'~/Prod_Images/Backyard/item-goose-plucked.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-34', N'BY-05', CAST(12.95 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Red', N'~/Prod_Images/Backyard/item-crab-red.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-35', N'BY-05', CAST(13.95 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Orange', N'~/Prod_Images/Backyard/item-crab-orange.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-36', N'BY-05', CAST(14.95 AS Decimal(10, 2)), CAST(10.00 AS Decimal(10, 2)), 1, N'P', N'Dotted', N'~/Prod_Images/Backyard/item-crab-dotted.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-37', N'BY-06', CAST(18.95 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Bad Smell', N'~/Prod_Images/Backyard/item-skunk-bad-smell.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-38', N'BY-06', CAST(20.95 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Really Bad Smell', N'~/Prod_Images/Backyard/item-skunk-really-bad-smell.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-39', N'BY-06', CAST(22.95 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Worst Smell', N'~/Prod_Images/Backyard/item-skunk-worst-smell.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-4', N'FI-02', CAST(17.50 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Extra Stretch', N'~/Prod_Images/Fish/item-balloon-extra-stretch.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-40', N'BY-07', CAST(859.95 AS Decimal(10, 2)), CAST(500.00 AS Decimal(10, 2)), 1, N'P', N'Tiny', N'~/Prod_Images/Backyard/item-zebra-tiny.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-41', N'BY-07', CAST(879.95 AS Decimal(10, 2)), CAST(500.00 AS Decimal(10, 2)), 1, N'P', N'Small', N'~/Prod_Images/Backyard/item-zebra-small.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-42', N'BY-07', CAST(899.95 AS Decimal(10, 2)), CAST(500.00 AS Decimal(10, 2)), 1, N'P', N'Medium', N'~/Prod_Images/Backyard/item-zebra-medium.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-43', N'BY-07', CAST(949.95 AS Decimal(10, 2)), CAST(500.00 AS Decimal(10, 2)), 1, N'P', N'Large', N'~/Prod_Images/Backyard/item-zebra-large.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-44', N'BD-01', CAST(41.95 AS Decimal(10, 2)), CAST(30.00 AS Decimal(10, 2)), 1, N'P', N'Flower Loving', N'~/Prod_Images/Birds/item-pelican-flowerloving.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-45', N'BD-01', CAST(45.95 AS Decimal(10, 2)), CAST(30.00 AS Decimal(10, 2)), 1, N'P', N'Grass Loving', N'~/Prod_Images/Birds/item-pelican-grassloving.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-46', N'BD-02', CAST(120.99 AS Decimal(10, 2)), CAST(99.00 AS Decimal(10, 2)), 1, N'P', N'Adventurous', N'~/Prod_Images/Birds/item-penguine-adventurous.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-47', N'BD-02', CAST(130.99 AS Decimal(10, 2)), CAST(99.00 AS Decimal(10, 2)), 1, N'P', N'Homey', N'~/Prod_Images/Birds/item-penguine-homey.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-48', N'BD-03', CAST(130.99 AS Decimal(10, 2)), CAST(99.00 AS Decimal(10, 2)), 1, N'P', N'Old', N'~/Prod_Images/Birds/item-pteranodon-old.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-49', N'BD-03', CAST(130.99 AS Decimal(10, 2)), CAST(99.00 AS Decimal(10, 2)), 1, N'P', N'Ancient', N'~/Prod_Images/Birds/item-pteranodon-ancient.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-5', N'FI-02', CAST(18.90 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Natural', N'~/Prod_Images/Fish/item-balloon-natural.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-50', N'BD-04', CAST(80.99 AS Decimal(10, 2)), CAST(50.00 AS Decimal(10, 2)), 1, N'P', N'Day', N'~/Prod_Images/Birds/item-owl-day.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-51', N'BD-04', CAST(85.99 AS Decimal(10, 2)), CAST(50.00 AS Decimal(10, 2)), 1, N'P', N'Night', N'~/Prod_Images/Birds/item-owl-night.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-52', N'BD-05', CAST(33.99 AS Decimal(10, 2)), CAST(20.00 AS Decimal(10, 2)), 1, N'P', N'Domestic', N'~/Prod_Images/Birds/item-duck-domestic.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-53', N'BD-05', CAST(38.99 AS Decimal(10, 2)), CAST(20.00 AS Decimal(10, 2)), 1, N'P', N'Wild', N'~/Prod_Images/Birds/item-duck-wild.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-54', N'BG-01', CAST(0.25 AS Decimal(10, 2)), CAST(0.02 AS Decimal(10, 2)), 1, N'P', N'Worker', N'~/Prod_Images/Bugs/item-ant-worker.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-55', N'BG-01', CAST(0.30 AS Decimal(10, 2)), CAST(0.02 AS Decimal(10, 2)), 1, N'P', N'Queen', N'~/Prod_Images/Bugs/item-ant-queen.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-56', N'BG-01', CAST(0.50 AS Decimal(10, 2)), CAST(0.02 AS Decimal(10, 2)), 1, N'P', N'Soldier', N'~/Prod_Images/Bugs/item-ant-soldier.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-57', N'BG-02', CAST(0.70 AS Decimal(10, 2)), CAST(0.10 AS Decimal(10, 2)), 1, N'P', N'Larva', N'~/Prod_Images/Bugs/item-butterfly-larva.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-58', N'BG-02', CAST(0.80 AS Decimal(10, 2)), CAST(0.10 AS Decimal(10, 2)), 1, N'P', N'Pupa', N'~/Prod_Images/Bugs/item-butterfly-pupa.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-59', N'BG-02', CAST(0.90 AS Decimal(10, 2)), CAST(0.10 AS Decimal(10, 2)), 1, N'P', N'Adult', N'~/Prod_Images/Bugs/item-butterfly-adult.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-6', N'FI-02', CAST(19.50 AS Decimal(10, 2)), CAST(12.00 AS Decimal(10, 2)), 1, N'P', N'Flammable', N'~/Prod_Images/Fish/item-balloon-flammable.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-60', N'BG-03', CAST(2.50 AS Decimal(10, 2)), CAST(1.00 AS Decimal(10, 2)), 1, N'P', N'Arniladisplicata', N'~/Prod_Images/Bugs/item-spider-aranielladisplicata.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-61', N'BG-03', CAST(2.60 AS Decimal(10, 2)), CAST(1.00 AS Decimal(10, 2)), 1, N'P', N'Dysdera Crocata', N'~/Prod_Images/Bugs/item-spider-dysderacrocata.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-62', N'BG-04', CAST(0.89 AS Decimal(10, 2)), CAST(0.15 AS Decimal(10, 2)), 1, N'P', N'Naked', N'~/Prod_Images/Bugs/item-slug-naked.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-63', N'BG-04', CAST(0.99 AS Decimal(10, 2)), CAST(0.15 AS Decimal(10, 2)), 1, N'P', N'Habitat', N'~/Prod_Images/Bugs/item-slug-habitat.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-64', N'BG-05', CAST(8.99 AS Decimal(10, 2)), CAST(2.50 AS Decimal(10, 2)), 1, N'P', N'False', N'~/Prod_Images/Bugs/item-frog-false.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-65', N'BG-05', CAST(9.99 AS Decimal(10, 2)), CAST(2.50 AS Decimal(10, 2)), 1, N'P', N'True', N'~/Prod_Images/Bugs/item-frog-true.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-66', N'BG-06', CAST(1.20 AS Decimal(10, 2)), CAST(0.80 AS Decimal(10, 2)), 1, N'P', N'Omnivore', N'~/Prod_Images/Bugs/item-dragonfly-omnivore.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-67', N'BG-06', CAST(1.30 AS Decimal(10, 2)), CAST(0.80 AS Decimal(10, 2)), 1, N'P', N'Vegetarian', N'~/Prod_Images/Bugs/item-dragonfly-vegetarian.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-68', N'BG-06', CAST(1.40 AS Decimal(10, 2)), CAST(0.80 AS Decimal(10, 2)), 1, N'P', N'Vegan', N'~/Prod_Images/Bugs/item-dragonfly-vegan.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-69', N'DR-01', CAST(150.00 AS Decimal(10, 2)), CAST(100.00 AS Decimal(10, 2)), 1, N'P', N'Male', N'~/Prod_Images/Endangered/item-skeleton-male.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-7', N'FI-03', CAST(21.50 AS Decimal(10, 2)), CAST(15.00 AS Decimal(10, 2)), 1, N'P', N'Blind', N'~/Prod_Images/Fish/item-blindfish-blind.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-70', N'DR-01', CAST(160.00 AS Decimal(10, 2)), CAST(100.00 AS Decimal(10, 2)), 1, N'P', N'Female', N'~/Prod_Images/Endangered/item-skeleton-female.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-71', N'DR-01', CAST(170.00 AS Decimal(10, 2)), CAST(100.00 AS Decimal(10, 2)), 1, N'P', N'Aphrodite', N'~/Prod_Images/Endangered/item-skeleton-aphrodite.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-72', N'DR-01', CAST(180.00 AS Decimal(10, 2)), CAST(100.00 AS Decimal(10, 2)), 1, N'P', N'Hermaphrodite', N'~/Prod_Images/Endangered/item-skeleton-hermaphrodite.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-73', N'DR-02', CAST(45.00 AS Decimal(10, 2)), CAST(22.00 AS Decimal(10, 2)), 1, N'P', N'Rover', N'~/Prod_Images/Endangered/item-pet-rover.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-74', N'DR-02', CAST(48.00 AS Decimal(10, 2)), CAST(22.00 AS Decimal(10, 2)), 1, N'P', N'Trumpet', N'~/Prod_Images/Endangered/item-pet-thumper.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-75', N'DR-02', CAST(49.00 AS Decimal(10, 2)), CAST(22.00 AS Decimal(10, 2)), 1, N'P', N'Kitty', N'~/Prod_Images/Endangered/item-pet-kitty.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-76', N'DR-03', CAST(349.00 AS Decimal(10, 2)), CAST(220.00 AS Decimal(10, 2)), 1, N'P', N'Spiky', N'~/Prod_Images/Endangered/item-dino-spiky.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-77', N'DR-03', CAST(379.00 AS Decimal(10, 2)), CAST(220.00 AS Decimal(10, 2)), 1, N'P', N'Shaved', N'~/Prod_Images/Endangered/item-dino-shaved.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-78', N'DR-03', CAST(399.00 AS Decimal(10, 2)), CAST(220.00 AS Decimal(10, 2)), 1, N'P', N'Pointy', N'~/Prod_Images/Endangered/item-dino-pointy.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-79', N'DR-04', CAST(1999.00 AS Decimal(10, 2)), CAST(1500.00 AS Decimal(10, 2)), 1, N'P', N'Exclusive', N'~/Prod_Images/Endangered/item-panda-exclusive.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-8', N'FI-03', CAST(22.50 AS Decimal(10, 2)), CAST(15.00 AS Decimal(10, 2)), 1, N'P', N'Short Sighted', N'~/Prod_Images/Fish/item-blindfish-shortsighted.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-80', N'DR-05', CAST(22.95 AS Decimal(10, 2)), CAST(16.00 AS Decimal(10, 2)), 1, N'P', N'Lost', N'~/Prod_Images/Endangered/item-fish-lost.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-81', N'DR-05', CAST(22.95 AS Decimal(10, 2)), CAST(16.00 AS Decimal(10, 2)), 1, N'P', N'Drunk', N'~/Prod_Images/Endangered/item-fish-drunk.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-82', N'DR-05', CAST(22.95 AS Decimal(10, 2)), CAST(16.00 AS Decimal(10, 2)), 1, N'P', N'Caught', N'~/Prod_Images/Endangered/item-fish-caught.gif')
INSERT [dbo].[Item] ([ItemId], [ProductId], [ListPrice], [UnitCost], [Supplier], [Status], [Name], [Image]) VALUES (N'EST-9', N'FI-03', CAST(24.50 AS Decimal(10, 2)), CAST(15.00 AS Decimal(10, 2)), 1, N'P', N'Far Sighted', N'~/Prod_Images/Fish/item-blindfish-farsighted.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BD-01', N'BIRDS', N'Pelican', N'Will sit in your garden and admire nature', N'~/Prod_Images/Birds/icon-pelican.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BD-02', N'BIRDS', N'Penguin', N'Guaranteed to stay by your side', N'~/Prod_Images/Birds/icon-penguin.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BD-03', N'BIRDS', N'Pteranodon', N'Can''t let go of the past? This is your bird', N'~/Prod_Images/Birds/icon-pteranodon.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BD-04', N'BIRDS', N'Owl', N'Your personal dictionary ? night & day', N'~/Prod_Images/Birds/icon-owl.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BD-05', N'BIRDS', N'Duck', N'Lisps but otherwise sings well', N'~/Prod_Images/Birds/icon-duck.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BG-01', N'BUGS', N'Ant', N'Trash your vacuum cleaner', N'~/Prod_Images/Bugs/icon-ant.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BG-02', N'BUGS', N'Butterfly', N'Increased beauty with age', N'~/Prod_Images/Bugs/icon-butterfly.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BG-03', N'BUGS', N'Spider', N'Loves a good massage', N'~/Prod_Images/Bugs/icon-spider.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BG-04', N'BUGS', N'Slug', N'Your soft hugging buddy', N'~/Prod_Images/Bugs/icon-slug.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BG-05', N'BUGS', N'Frog', N'Want to get rid of an insect previously bought?', N'~/Prod_Images/Bugs/icon-frog.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BG-06', N'BUGS', N'Dragonfly', N'Beware of the meat lover', N'~/Prod_Images/Bugs/icon-dragonfly.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-01', N'BYARD', N'Sheep', N'Your soft hugging buddy', N'~/Prod_Images/Backyard/icon-sheep.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-02', N'BYARD', N'Cat', N'The friend you will never see', N'~/Prod_Images/Backyard/icon-cat.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-03', N'BYARD', N'Raccoon', N'Always keeps your dishes clean', N'~/Prod_Images/Backyard/icon-raccoon.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-04', N'BYARD', N'Goose', N'For your protection delivered in our special safety-bag', N'~/Prod_Images/Backyard/icon-goose.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-05', N'BYARD', N'Crab', N'The common house crab which lives in the refrigerator', N'~/Prod_Images/Backyard/icon-crab.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-06', N'BYARD', N'Skunk', N'You will love it - especially when you have your in-laws visiting', N'~/Prod_Images/Backyard/icon-skunk.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'BY-07', N'BYARD', N'Zebra', N'The horse of the modern girl', N'~/Prod_Images/Backyard/icon-zebra.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'DR-01', N'EDANGER', N'Skeleton', N'Dumb but hollow', N'~/Prod_Images/Endangered/icon-skeleton.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'DR-02', N'EDANGER', N'Pet', N'The originals ? honestly!', N'~/Prod_Images/Endangered/icon-pet.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'DR-03', N'EDANGER', N'Dino', N'Special offer: only for a limited time', N'~/Prod_Images/Endangered/icon-dino.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'DR-04', N'EDANGER', N'Panda', N'Last one ? go for it!', N'~/Prod_Images/Endangered/icon-panda.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'DR-05', N'EDANGER', N'Fish', N'They are waiting for your help', N'~/Prod_Images/Endangered/icon-fish.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-01', N'FISH', N'Meno', N'Your worried tiny friend warns you about life''s dangers', N'~/Prod_Images/Fish/icon-meno.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-02', N'FISH', N'Balloonfish', N'It''s your thermometer - the hotter it gets the bigger it gets', N'~/Prod_Images/Fish/icon-ballonfish.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-03', N'FISH', N'Blindfish', N'Likes pressure - ideal for divorcing couples', N'~/Prod_Images/Fish/icon-blindfish.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-04', N'FISH', N'Crabfish', N'Dances and sings every time you feed it!', N'~/Prod_Images/Fish/icon-Crabfish.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-05', N'FISH', N'Eucalyptus', N'For the tickle on your hands: you''ll love the massage', N'~/Prod_Images/Fish/icon-eucalyptus.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-06', N'FISH', N'Mister No', N'Need a companion for the dark times?', N'~/Prod_Images/Fish/icon-misterno.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-07', N'FISH', N'Nosyfish', N'Don''t underestimate this one - it bites!', N'~/Prod_Images/Fish/icon-nosyfish.gif')
INSERT [dbo].[Product] ([ProductId], [CategoryId], [Name], [Descn], [Image]) VALUES (N'FI-08', N'FISH', N'Tooth Ferry', N'Very sensitive vegetarian, needs food every two months', N'~/Prod_Images/Fish/icon-toothferry.gif')
INSERT [dbo].[Supplier] ([SuppId], [Name], [Status], [Addr1], [Addr2], [City], [State], [Zip], [Phone]) VALUES (1, N'XYZ Pets', N'AC', N'600 Avon Way', N'', N'Los Angeles', N'CA', N'94024', N'212-947-0797')
INSERT [dbo].[Supplier] ([SuppId], [Name], [Status], [Addr1], [Addr2], [City], [State], [Zip], [Phone]) VALUES (2, N'ABC Pets', N'AC', N'700 Abalone Way', N'', N'San Francisco', N'CA', N'94024', N'415-947-0797')
SET ANSI_PADDING ON
GO
/****** Object: Index [IxItem] Script Date: 2020/4/13 20:44:07 ******/
CREATE NONCLUSTERED INDEX [IxItem] ON [dbo].[Item]
(
[ProductId] ASC,
[ItemId] ASC,
[ListPrice] ASC,
[Name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IxProduct1] Script Date: 2020/4/13 20:44:07 ******/
CREATE NONCLUSTERED INDEX [IxProduct1] ON [dbo].[Product]
(
[Name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IxProduct2] Script Date: 2020/4/13 20:44:07 ******/
CREATE NONCLUSTERED INDEX [IxProduct2] ON [dbo].[Product]
(
[CategoryId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IxProduct3] Script Date: 2020/4/13 20:44:07 ******/
CREATE NONCLUSTERED INDEX [IxProduct3] ON [dbo].[Product]
(
[CategoryId] ASC,
[Name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
SET ANSI_PADDING ON
GO
/****** Object: Index [IxProduct4] Script Date: 2020/4/13 20:44:07 ******/
CREATE NONCLUSTERED INDEX [IxProduct4] ON [dbo].[Product]
(
[CategoryId] ASC,
[ProductId] ASC,
[Name] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Item] WITH CHECK ADD FOREIGN KEY([ProductId])
REFERENCES [dbo].[Product] ([ProductId])
GO
ALTER TABLE [dbo].[Item] WITH CHECK ADD FOREIGN KEY([Supplier])
REFERENCES [dbo].[Supplier] ([SuppId])
GO
ALTER TABLE [dbo].[Product] WITH CHECK ADD FOREIGN KEY([CategoryId])
REFERENCES [dbo].[Category] ([CategoryId])
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCachePollingStoredProcedure] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AspNet_SqlCachePollingStoredProcedure] AS
SELECT tableName, changeId FROM dbo.AspNet_SqlCacheTablesForChangeNotification
RETURN 0
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheQueryRegisteredTablesStoredProcedure] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AspNet_SqlCacheQueryRegisteredTablesStoredProcedure]
AS
SELECT tableName FROM dbo.AspNet_SqlCacheTablesForChangeNotification
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheRegisterTableStoredProcedure] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AspNet_SqlCacheRegisterTableStoredProcedure]
@tableName NVARCHAR(450)
AS
BEGIN
DECLARE @triggerName AS NVARCHAR(3000)
DECLARE @fullTriggerName AS NVARCHAR(3000)
DECLARE @canonTableName NVARCHAR(3000)
DECLARE @quotedTableName NVARCHAR(3000)
/* Create the trigger name */
SET @triggerName = REPLACE(@tableName, '[', '__o__')
SET @triggerName = REPLACE(@triggerName, ']', '__c__')
SET @triggerName = @triggerName + '_AspNet_SqlCacheNotification_Trigger'
SET @fullTriggerName = 'dbo.[' + @triggerName + ']'
/* Create the cannonicalized table name for trigger creation */
/* Do not touch it if the name contains other delimiters */
IF (CHARINDEX('.', @tableName) <> 0 OR
CHARINDEX('[', @tableName) <> 0 OR
CHARINDEX(']', @tableName) <> 0)
SET @canonTableName = @tableName
ELSE
SET @canonTableName = '[' + @tableName + ']'
/* First make sure the table exists */
IF (SELECT OBJECT_ID(@tableName, 'U')) IS NULL
BEGIN
RAISERROR ('00000001', 16, 1)
RETURN
END
BEGIN TRAN
/* Insert the value into the notification table */
IF NOT EXISTS (SELECT tableName FROM dbo.AspNet_SqlCacheTablesForChangeNotification WITH (NOLOCK) WHERE tableName = @tableName)
IF NOT EXISTS (SELECT tableName FROM dbo.AspNet_SqlCacheTablesForChangeNotification WITH (TABLOCKX) WHERE tableName = @tableName)
INSERT dbo.AspNet_SqlCacheTablesForChangeNotification
VALUES (@tableName, GETDATE(), 0)
/* Create the trigger */
SET @quotedTableName = QUOTENAME(@tableName, '''')
IF NOT EXISTS (SELECT name FROM sysobjects WITH (NOLOCK) WHERE name = @triggerName AND type = 'TR')
IF NOT EXISTS (SELECT name FROM sysobjects WITH (TABLOCKX) WHERE name = @triggerName AND type = 'TR')
EXEC('CREATE TRIGGER ' + @fullTriggerName + ' ON ' + @canonTableName +'
FOR INSERT, UPDATE, DELETE AS BEGIN
SET NOCOUNT ON
EXEC dbo.AspNet_SqlCacheUpdateChangeIdStoredProcedure N' + @quotedTableName + '
END
')
COMMIT TRAN
END
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheUnRegisterTableStoredProcedure] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AspNet_SqlCacheUnRegisterTableStoredProcedure]
@tableName NVARCHAR(450)
AS
BEGIN
BEGIN TRAN
DECLARE @triggerName AS NVARCHAR(3000)
DECLARE @fullTriggerName AS NVARCHAR(3000)
SET @triggerName = REPLACE(@tableName, '[', '__o__')
SET @triggerName = REPLACE(@triggerName, ']', '__c__')
SET @triggerName = @triggerName + '_AspNet_SqlCacheNotification_Trigger'
SET @fullTriggerName = 'dbo.[' + @triggerName + ']'
/* Remove the table-row from the notification table */
IF EXISTS (SELECT name FROM sysobjects WITH (NOLOCK) WHERE name = 'AspNet_SqlCacheTablesForChangeNotification' AND type = 'U')
IF EXISTS (SELECT name FROM sysobjects WITH (TABLOCKX) WHERE name = 'AspNet_SqlCacheTablesForChangeNotification' AND type = 'U')
DELETE FROM dbo.AspNet_SqlCacheTablesForChangeNotification WHERE tableName = @tableName
/* Remove the trigger */
IF EXISTS (SELECT name FROM sysobjects WITH (NOLOCK) WHERE name = @triggerName AND type = 'TR')
IF EXISTS (SELECT name FROM sysobjects WITH (TABLOCKX) WHERE name = @triggerName AND type = 'TR')
EXEC('DROP TRIGGER ' + @fullTriggerName)
COMMIT TRAN
END
GO
/****** Object: StoredProcedure [dbo].[AspNet_SqlCacheUpdateChangeIdStoredProcedure] Script Date: 2020/4/13 20:44:07 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE PROCEDURE [dbo].[AspNet_SqlCacheUpdateChangeIdStoredProcedure]
@tableName NVARCHAR(450)
AS
BEGIN
UPDATE dbo.AspNet_SqlCacheTablesForChangeNotification WITH (ROWLOCK) SET changeId = changeId + 1
WHERE tableName = @tableName
END
GO
USE [master]
GO
ALTER DATABASE [MSPetShop4] SET READ_WRITE
GO
2、
5.返回顶部 |
1、
2、
6.返回顶部 |
作者:ylbtech 出处:http://ylbtech.cnblogs.com/ 本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。 |
来源:oschina
链接:https://my.oschina.net/u/4315481/blog/3234130