Możemy użyć GO [Count], aby uruchomić wsad w żądanym czasie. Aby wstawić rekordy do tabeli, która ma tylko kolumnę tożsamości, możemy również użyć instrukcji GO z parametrem count.
USE TestDB
GO
DROP TABLE dbo.CustomerAddress
GO
CREATE TABLE dbo.CustomerAddress (
FName VARCHAR(100)
,LName VARCHAR(100)
,HouseNumber INT
,StreetName VARCHAR(100)
,City VARCHAR(100)
,[State] CHAR(2)
,IsActive BIT
)
GO
--Insert the same record ten times by using GO [count]
INSERT INTO dbo.CustomerAddress
VALUES (
'Aamir'
,'Shahzad'
,123
,'Test Street'
,'Charlotte'
,'NC'
,1
) GO 10
CREATE TABLE dbo.CustomerT (id INT identity(1, 1))
GO
--Insert 100 records into table that has only id as identity column by using GO [Count]
INSERT INTO dbo.CustomerT DEFAULT
VALUES GO 100 Wideo demonstracyjne:użyj instrukcji GO w programie SQL Server, aby wstawić rekordy w kolumnie tożsamości