ms sql 스크립트로 데이타 넣기

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TABLE [dbo].[COMPANY](
[COMPANYID] [int] NOT NULL,
[COMPANYNAME] [nvarchar](150) NULL,
[COMPANYEMAIL] [nvarchar](150) NULL,
[COMPANYSIZE] [nvarchar](150) NULL,
CONSTRAINT [PK_COMPANY] PRIMARY KEY CLUSTERED
(
[COMPANYID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

 

declare @idx int
set @idx = 0

while(@idx<1000000)
Begin
INSERT INTO [Enterprise4].[dbo].[COMPANY]
([COMPANYID]
,[COMPANYNAME]
,[COMPANYEMAIL]
,[COMPANYSIZE])
VALUES
(@idx
,’company’
,’com@email.com’
,100000)

set @idx = @idx +1

end

GO