资源描述:
《C#三层架构-0数据表设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、1.打开sqlserver创建数据库,命名为ATM2.数据表结构如下:数据库名:ATM表名:cardinfo序号列名数据类型长度小数位标识主键允许空默认值说明1cardIDvarchar160是否2curTypevarchar200是irrpb?3savingTypevarchar200否4openDate83是驴tdate5opeiJfloneyfloat80否06balancefloat8007passvarchar60是8888888IsReportLoswbit10是09customerlDirit40否表名:translnfo序号列名数据类型长度小数位标识允许空默认值说明1
2、transDate83是否2cardIDvarchar160否3transTypenchar100否4transMoneyfloat80否5remarkvarchar1000是表名:userinfo序号列名数据类型长度小数位标识主键允许空默认值说明1custoidqtIDirit40是是否2customerNamevarchar200否3pIDvarchar180否4telephonevarchar130否5addressvarchar1000是3.执行卜•面的代码创建数据表ifexists(select*fromsysobjectswhereid=OBJECT_ID('[cardi
3、nfo]')andOBJECTPROPERTY(id,1IsUserTablJ)=1)DROPTABLE[cardinfo]CREATETABLE[cardinfo]([cardID][varchar](16)NOTNULL,[curType][varchar](20)NULLDEFAULT(N'RMB*)z[savingType][varchar](20)NOTNULL,[openDate][datetime]NULLDEFAULT(getdute()),[openMoney][float]NOTNULLDEFAULT(0),[balance][float]NOTNULLDEFAU
4、LT(0),[pass][varchar](6)NULLDEFAULT(888888),[IsReportLoss][bit]NULLDEFAULT(0),[customerlD][int]NOTNULL)ALTERTABLE[cardinfo]WITHNOCHECKADDCONSTRAINT[PK_cardinfo]PRIMARYKEYNONCLUSTERED([cardID])INSERT[cardinfo]([cardID],[curType]/[savingType]/[openDate]/[openMoney],[balance],[pass],[IsReportLoss]
5、,[customerlD])VALUES(N*1010357612121134*,N1RMB*,N*定期1zN*2016/3/1318:02:32lz22712zN,llllll,z0z2)INSERT[cardinfo]([cardID],[curType],[savingType],[openDate],[openMoney]/[balance],[pass],[IsReportLoss],[customerlD])VALUES(N11010357612121140RMB',N*活期1,N*2016/3/1623:43:35’,200,200,N'123456',0,4)INS
6、ERT[cardinfo]([cardID],[curType],[savingType],[openDate],[openMoney]p[balance],[pass],[IsReportLoss],[customerlD])VALUES(N*1010357612121154',N'RMB',N'活期',N'2016/3/1623:54:57',800,800,N'666666',0,5)INSERT[cardinfo]([cardID],[curType],[savingType],[openDate],[openMoney],[balance],[pass],[IsReport
7、Loss],[customerlD])VALUES(N11010357612121164N1RMB1zN1活期T,N12016/5/1523:32:17',1,1,NT23456‘,0,4)INSERT[cardinfo]([cardID],[curType],[savingType],[openDate],[openMoney]/[balance],[pass],[IsReportLoss]z[customerlD])VALUES(N*10103576