• 用无参存储过程循环插入测试数据


     1 USE [数据库名称]
     2 SET ANSI_NULLS ON
     3 GO
     4 SET QUOTED_IDENTIFIER ON
     5 GO
     6 alter PROCEDURE dbo.pro_photosImport
     7 AS
     8 declare @i int
     9 set @i = 1
    10 declare @uid int
    11 set @uid= 1
    12 declare @username varchar(64)
    13 set @username =''
    14 declare @cat int
    15 set @cat = 1
    16 while (@i < 600000)
    17 begin
    18 Set @i =@i +1
    19 select @uid = userid,@username=username from  dbo.spb_Users select @cat = categoryid 
    from dbo.spb_PhotoUserCategories 20 INSERT INTO [dbo].[spb_Photos]([OwnerUserID],[UserCategoryID],[SiteCategoryID],[Author],[PostDate],
    [LastRepliedDate],[PrivacyStatus],
    [IsLocked],[Password],[AuditingStatus],[IsEssential],[SpecialOrder],
    [StickyDate],[HitTimes],[CommentCount],[RssViewTimes],[RatingSum],[TotalRatings],[Subject],[Body],
    [UserHostAddress],[FileName],[ContentType],[ContentSize],[Height],[Width],[PropertyNames],[PropertyValues])
    22 VALUES(@uid,@cat,0,@username,getdate(),getdate(),30,0,'',40,0,0,'1754-01-01 00:00:00.000',
    1,0,0,0,0,'可爱的图片','我很细可爱的图片哦!','192.168.1.65','2788267502545.jpg','image/jpeg',
    32897,493,330,null,null) 23 end 24 go
  • 相关阅读:
    Flask 开启跨域
    pandas to dict
    mongodb 聚合查询
    flask 获取请求参数
    CSS dppx详解
    用CSS做出漂亮的字体动画
    VMware虚拟主机安装完成后连接不上网络
    wokerman中自定义协议的使用和测试
    使用workerman写一个小的聊天室
    telnet不能使用怎么办?
  • 原文地址:https://www.cnblogs.com/summers/p/3066207.html
Copyright © 2020-2023  润新知