have a procedure which doesnt look nice!! I want to create a matrix of numbers, based on inputs from a user. Can anyone show me a better way of doing this? create procedure sp_createPlacements( @buildingID int = NULL, @areaID int = NULL, @typeID int = NULL, @rows int = NULL)ASBEGINDECLARE @units intDECLARE @shelves intDECLARE @slots intSELECT @units = units, @shelves = shelves, @slots = slots FROM [dbo].[PlacementType]WHERE typeID = @typeIDDECLARE @rowCount intDECLARE @unitCount intDECLARE @shelfCount intDECLARE @slotCount intSET @rowCount = 0SET @unitCount = 0SET @shelfCount = 0SET @slotCount = 0WHILE @rowCount <= @rowsBEGIN SET @rowCount = @rowCount + 1 WHILE @unitCount <= @units BEGIN SET @unitCount = @unitCount + 1 WHILE @shelfCount <= @shelves BEGIN SET @shelfCount = @shelfCount + 1 WHILE @slotCount <= @slots BEGIN SET @slotCount = @slotCount + 1 INSERT INTO [dbo].[Placement](buildingID, areaID, typeID, row, unit, shelf, slot) VALUES(@buildingID, @areaID, @typeID, @rowCount, @unitCount, @shelfCount, @slotCount) END SET @slotCount = 0 END SET @shelfCount = 0 END SET @unitCount = 0ENDEND