赞
踩
1.普通循环
Create table WS_Student
(
[Id] int primary key not null,
[My_Cocode] [int],
[My_SCocode] [int],
[userId] [bigint],
[SetCName] [varchar](50) NULL,
[SetEName] [varchar](50) NULL,
[SetPcode] [varchar](50) NULL,
[SetScode] [varchar](50) NULL,
[SetValue] [varchar](50) NULL,
[SetSql] [varchar](500) NULL,
[Sort] [Int] NULL,
[IsTurnOn] [bit] NULL,
[IsSystem] [bit] NULL,
[Remarks] [varchar](50) NULL,
[CreatedUserId] [bigint] NULL,
[CreatedUserName] [varchar](50) NULL,
[CreatedTime] [datetime] NULL,
[UpdatedUserId] [bigint] NULL,
[UpdatedUserName] [varchar](50) NULL,
[UpdatedTime] [datetime] NULL,
[IsDeleted] [bit] NULL
)
INSERT INTO WS_Student VALUES(1,21114001,21114005,0,'是否学生','是否学生','WS_Student',
'WS_Student_IsStudent','1',null,1,1,1,'是否学生',999999,'shil',GETDATE(),999999,'shil',GETDATE(),0)
INSERT INTO WS_Student VALUES(2,21114001,21114005,0,'是否学生2','是否学生2','WS_Student',
'WS_Student_IsStudent2','1',null,1,1,1,'是否学生2',999999,'shil',GETDATE(),999999,'shil',GETDATE(),0)
--循环5次来新增学生表信息
--循环遍历修改记录--
declare @i int
set @i=7
while @i<9
begin
INSERT INTO WS_Student VALUES((@i,21114001,21114005,0,'是否学生','是否学生','WS_Student',
'WS_Student_IsStudent','1',null,1,1,1,'是否学生',999999,'shil',GETDATE(),999999,'shil',GETDATE(),0)
set @i=@i +1
end
--查看结果--
select * from WS_Student
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。