DECLARE @Count INT; DECLARE @BuildingId VARCHAR(16); DECLARE @FloorId VARCHAR(16); DECLARE @RoomId VARCHAR(16); DECLARE @RoomName NVARCHAR(20); DECLARE @Name NVARCHAR(20); BEGIN SET @Count = 1; SET @BuildingId = '0000000000000999'; SET @FloorId = '0000000000000999'; SET @RoomId = '0000000000009999'; SET @RoomName = N'999'; SET @Name = N'999'; WHILE @Count <= 180 BEGIN INSERT INTO dbo.Xq_Bed ( Id, BuildingId, FloorId, RoomId, RoomName, Name, Status, CreateTime, IsDeleted ) VALUES (NEWID(), @BuildingId, @FloorId, @RoomId, @RoomName, @Name + '-' + CAST(@Count AS VARCHAR), 99, SYSDATETIME(), 0 ); SET @Count = @Count + 1; END; END;
1