There is an insert procedure:
ALTER PROCEDURE [dbo].[BSOs_InsertBso] @Domain_username nvarchar(50)='Max' ,@ProductCode int=100 ,@BsoNumber int=12000 AS BEGIN SET NOCOUNT ON; INSERT INTO [dbo].[BSOs] ([BsoCode] ,[BsoNumber] ,[Owner] ,[FullNumber]) Select bt.bsoCode ,@BsoNumber ,@Domain_username , bt.BsoPrefix + right('00000000000'+cast(@BsoNumber as varchar(10)), NumberLen) From dbo.BsoTypes bt inner join BsoToInsProduct bp on bp.BsoCode = bt.BsoCode where @ProductCode = bp.InsProductCode END
Now I need to create a procedure that adds to the table [dbo].[BSOs]
range of 16000 - 16100 BSU numbers (entries) for each product through the cursor.
That is, setting the parameter automatically added to the table
Make the cursor with the parameters, for example:
DECLARE @Domain_username nvarchar(50)='Alex' ,@StartBsoNumber int=16000 ,@Count int =100 -- количество бСО которые нужно создать
How to create a procedure using a cursor? Or cursor syntax in my cases
N
similar records that differ only in theBsoCode
field (and, accordingly,FullNumber
)? - cyadvertBsoNumber
andFullNumber
. So? - cyadvert