⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 create 50,000 inventory.sql

📁 基于微软的 ASP.NET+C#开发的PETSHOP(网上宠物店)项目,在性能及开发效率上明显优于基于SUN J2EE框架开发的PETSHOP. 项目包括所有源码及数据库建库脚本,是不错的学习 AS
💻 SQL
字号:
/******************************************************************************
**        File: Create 50,000 Ineventory.sql
**        Name: Benchmark Data Load
**        Desc: Adds 50,000 items to the inventory table. Sample Output:
**
**        itemid     qty
**        ---------- -----------
**        EST-1      10000
**
**        Date: 11/6/2001
**
*******************************************************************************/

-- SET NOCOUNT to ON and no longer display the count message
SET NOCOUNT ON

DECLARE @itemid char(10)
DECLARE @qty int

DECLARE @i int
SELECT @i = 1

PRINT 'Inserting into the Inventory table: ' + convert(varchar(255), getdate());

WHILE (@i <= 50000)
BEGIN    
    -- unique item id
    select @itemid = rtrim('EST-' + convert(varchar(10), @i))
   
    select @qty = 10000

	-- insert the new product
    EXEC upInventoryAdd @itemid, @qty
	
    -- output a progress message    
    IF @i % 1000 = 0 PRINT @i

    SELECT @i = @i + 1
END

-- Reset SET NOCOUNT to OFF
SET NOCOUNT OFF

PRINT 'Completed: ' + convert(varchar(255), getdate());

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -