2000:
CREATE TABLE
dbo.TEST
(
ID
INT
IDENTITY
(
1
,
1
),
ROWID uniqueidentifier
)
CREATE TABLE
dbo.TEST2
(
ID
INT
IDENTITY
(
1
,
1
),
ROWID uniqueidentifier
)
GO
DECLARE
@counter
INT
SET
@counter
=
0
WHILE
@counter
<
1000
BEGIN
INSERT INTO
dbo.TEST
(
ROWID
)
VALUES
(
NEWID
())
INSERT INTO
dbo.TEST2
(
ROWID
)
VALUES
(
NEWID
())
SET
@counter
=
@counter
+
1
END
2005:
Example 1:
Example 1:
CREATE TABLE
dbo.TEST
(
ID
INT
IDENTITY
(
1
,
1
),
ROWID uniqueidentifier
)
GO
INSERT INTO
dbo.TEST
(
ROWID
)
VALUES
(
NEWID
())
GO 1000
/*executes both insert statement 1000 times.*/
Example 2:
CREATE TABLE
dbo.TEST
(
ID
INT
IDENTITY
(
1
,
1
),
ROWID uniqueidentifier
)
CREATE TABLE
dbo.TEST2
(
ID
INT
IDENTITY
(
1
,
1
),
ROWID uniqueidentifier
)
GO
INSERT INTO
dbo.TEST
(
ROWID
)
VALUES
(
NEWID
())
INSERT INTO
dbo.TEST2
(
ROWID
)
VALUES
(
NEWID
())
GO 1000
/*executes both insert statement 1000 times.*/
No comments:
Post a Comment