SQL 自动生成1000条Guid

DECLARE @total INT;
DECLARE @i INT;
CREATE TABLE #show
(
ID UNIQUEIDENTIFIER NULL
);
SET @total=1000;
SET @i=1;
WHILE(@i<=@total)
BEGIN
    INSERT INTO #show
    VALUES  ( NEWID())
    SET @i=@i+1;
END 
SELECT * FROM #show;
DROP TABLE #show;

你可能感兴趣的:(SQL)