开发者社区 问答 正文

如何用随机数据填充数据库的所有表?

如何用随机数据填充数据库的所有表?

展开
收起
贺贺_ 2019-12-17 17:50:17 1172 分享 版权
1 条回答
写回答
取消 提交回答
  • 我通常使用的非常简单的 SQL:

    create table fillTbl (msg nvarchar(255))
    insert into fillTbl select top 4285 description from sys.sysmessages where msglangid=1033 -- ~ 1 Mo
    GO 100 -- the number of Mo you want to add
    exec sp_spaceused 'fillTbl' -- space in the table
    exec sp_spaceused -- space in the database
    -- drop table fillTbl -- reset the space added
    
    2019-12-17 17:50:40
    赞同 展开评论
问答分类:
问答地址: