sql中批量插入数据、char与int拼接实例
sql中批量插入数据、char与int拼接实例
declare @i int set @i=100000 while(@i<100010) begin declare @applyId uniqueidentifier set @applyId=newid() insert [dbo].[LoanApply] ([ApplyId], [BankId], [Proposer], [PhoneNum], [BidderNo], [Region], [CardNo], [Tel], [Amount], [Address], [PostType], [BankNeedInfos], [ApplyTime], [AcceptStatus], [AcceptTime], [AcceptUser], [AcceptExpiryTime], [CheckStatus], [CheckTime], [CheckUser], [PaymentStatus], [PaymentTime], [PaymentUser], [MoneyCheckStatus], [MoneyCheckTime], [MoneyCheckUser], [ApplyType], [BusinessType], [HaveCreditCard], [AucID], [MoneyTransferStatus], [MoneyTransferTime], [MoneyTransferUser], [ApplyChannel], [ExtraCharge], [Education], [Income], [OrderCode], [OperateCount], [JsApplySeq], [ApprovalAmount], [ReviewChannel]) values (@applyId, N'd243473d-1340-4ecc-964c-c91c2653b029', N'测试用户', N'14100'+ cast(@i as varchar), cast(@i as varchar)+'00', NULL , N'371521200001'+cast(@i AS varchar), NULL, CAST(91860.00 AS Decimal(18, 2)), NULL , 0, N'<DocumentElement><bankinfo><key>period</key><value>60</value></bankinfo></DocumentElement>', getdate(), 0, NUlL,NUlL,DateAdd(yy,1,getdate()), 0, NUlL, NUlL, 0, NULL, NULL, 0, NULL, NULL, 0, 1, 0, 258, 0, NULL, NULL, N'APP', CAST(50000.00 AS Decimal(18, 2)), NULL, NULL, '20220818120000'+cast(@i AS varchar), 0, NULL, NULL, NULL) set @i=@i+1 end