time 
设为首页】【收藏本站
当前位置: 主页 > 数据库 > 数据库理论 > PowerDesigner批量生成日期型、中文字符型、数字型测试数据

PowerDesigner批量生成日期型、中文字符型、数字型测试数据

时间:2012-05-13 01:08 点击:3726次 字体:[ ]




Powerdesigner可以在数据模型中方便地生成测试数据。本文主要简介利用PowerDesigner生成三种基本类型的数据:日期型、中文字符型、数字型。

基本测试表如下:

PowerDesigner批量生成日期型、中文字符型、数字型测试数据_www.fengfly.com

if exists (select 1
from sysobjects
where id = object_id('DepartDemo')
and type = 'U')
drop table DepartDemo
go

/*==============================================================*/
/* Table: DepartDemo */
/*==============================================================*/
create table DepartDemo (
PKID int identity(101,1),
DName nvarchar(200) null,
DCode nvarchar(500) null,
Manager nvarchar(50) null,
ParentID int null default 0,
AddUser nvarchar(50) null,
AddTime datetime null,
ModUser nvarchar(50) null,
ModTime datetime null,
CurState smallint not null default 0,
Remark nvarchar(500) null,
F1 int not null default 0,
F2 nvarchar(300) null,
constraint PK_DEPARTDEMO primary key (PKID)
)
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'部门表',
'user', @CurrentUser, 'table', 'DepartDemo'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'主键ID',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'PKID'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'名称',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'DName'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'编码',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'DCode'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'主管',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'Manager'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'上级部门',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'ParentID'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'申请人',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'AddUser'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'申请时间',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'AddTime'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'修改人',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'ModUser'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'修改时间',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'ModTime'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'当前状态',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'CurState'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'备注',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'Remark'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'扩展1',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'F1'
go

declare @CurrentUser sysname
select @CurrentUser = user_name()
execute sp_addextendedproperty 'MS_Description',
'扩展2',
'user', @CurrentUser, 'table', 'DepartDemo', 'column', 'F2'
go



 



本文地址 : http://www.fengfly.com/plus/view-207564-1.html
标签: 测试数据 批量生成 日期型 中文字符型 数字型
------分隔线----------------------------
相关文章
最新评论 查看所有评论
发表评论 查看所有评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
表情:
验证码: