|
IF OBJECT_ID('SalesHistory')>0 [bitsCN.Com]
DROP TABLE SalesHistory; [bitsCN.Com]
GO BBS.bitsCN.com网管论坛
CREATE TABLE [dbo].[SalesHistory] www_bitscn_com中国.网管联盟
( bitsCN~com
[SaleID] [int] IDENTITY(1,1) NOT NULL PRIMARY KEY, bbs.bitsCN.com
[Product] [varchar](10) NULL, bitsCN.nET*中国网管博客
[SaleDate] [datetime] NULL, 中国_网管联盟bitsCN.com
[SalePrice] [money] NULL www@bitscn@com
) bbs.bitsCN.com
GO DECLARE @i SMALLINT 中国_网管联盟bitsCN.com
SET @i = 1WHILE (@i <=100) bitsCN.nET*中国网管博客
BEGIN BBS.bitsCN.com网管论坛
INSERT INTO SalesHistory(Product, SaleDate, SalePrice) bitsCN#com中国网管联盟
VALUES('Computer', DATEADD(mm, @i, '3/11/1919'), DATEPART(ms, GETDATE()) + (@i + 57)) bitsCN~com
INSERT INTO SalesHistory(Product, SaleDate, SalePrice) bitsCN~com
VALUES('BigScreen', DATEADD(mm, @i, '3/11/1927'), DATEPART(ms, GETDATE()) + (@i + 13)) BBS.bitsCN.com网管论坛
INSERT INTO SalesHistory(Product, SaleDate, SalePrice) www_bitscn_com中国.网管联盟
VALUES('PoolTable', DATEADD(mm, @i, '3/11/1908'), DATEPART(ms, GETDATE()) + (@i + 29))SET @i = @i + 1 www@bitscn@com
END [bitsCN.Com]
GOINSERT INTO l_SalesProducts(Product) [bitsCN_com]
SELECT 'BigScreen' 中国_网管联盟bitsCN.com
UNION bitsCN.nET*中国网管博客
SELECT 'Computer' 中国_网管联盟bitsCN.com
UNION [bitsCN.Com]
SELECT 'PoolTable' www@bitscn@com |