标签:模拟 pre ble sel 插入 技术分享 object_id images drop
有时为了测试,会模拟大量数据,sql server 2005 以后,可以通过 go 语句进行循环执行插入
例1:循环插入
IF OBJECT_ID(‘TB1‘) IS NOT NULL DROP TABLE TB1 CREATE TABLE TB1 ( ID INT IDENTITY , NAME VARCHAR(24), DTDATE DATETIME ) GO --此处一定要加go,不然 go 100 会从头开始循环 INSERT INTO TB1 VALUES (‘TEST‘+CONVERT(VARCHAR,CONVERT(INT,RAND()*100)),GETDATE()) GO 100 SELECT COUNT(*) COUNT FROM TB1
标签:模拟 pre ble sel 插入 技术分享 object_id images drop
原文地址:http://www.cnblogs.com/vitaminC/p/6210458.html