日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

建立数据库

發布時間:2025/3/20 数据库 17 豆豆
生活随笔 收集整理的這篇文章主要介紹了 建立数据库 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

建立數據庫

?

? ? ? ? ? ? 很簡單,都是重復的代碼,但是還有一些小的問題,具體說明如下
技巧以第一個表basicdata基本信息表為例,建立表的時候,參考已有的機房數據庫簡歷表,找到對應的表,表下的列,展開,你會發現有很清楚的說明,直接參照建立即可。


? ? ? ? ? 從中可以知道,basicdata表中的每個列的字段,包括字段名,數據類型,長度約束,是否允許為空,還有是否設置各種約束等。

?

?

?

create table [dbo].[basicdata_info]( [rate][numeric](19,4)not null, [tmprate][numeric](19,4)not null, [unittime][int]not null, [leasttime][int]not null, [preparetime][int]not null, [limitcash][numeric](19,4)not null, [head][char](10)not null, [date][date]not null, [time][time](0)not null )on [primary] go

?

同理,具體的代碼如下:

?

?

use master goif exists(select*from dbo.sysdatabases where name='charge_sys') drop database student gocreate database charge_sys go use charge_sys goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[basicdata_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[basicdata_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[cancelcard_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[cancelcard_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[checkday_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[checkday_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[checkweek_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[checkweek_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[line_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[line_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[online_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[online_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[onwork_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[onwork_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[recharge_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[recharge_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[student_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[student_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[user_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[user_info] goif exists(select*from dbo.sysobjects where id=object_id(N'[dbo].[worklog_info]')and objectproperty(id,N'isusertable')=1) drop table [dbo].[worklog_info] gocreate table [dbo].[basicdata_info]( [rate][numeric](19,4)not null, [tmprate][numeric](19,4)not null, [unittime][int]not null, [leasttime][int]not null, [preparetime][int]not null, [limitcash][numeric](19,4)not null, [head][char](10)not null, [date][date]not null, [time][time](0)not null )on [primary] gocreate table [dbo].[cancelcard_info]( [studentno][char](10)not null, [cardno][char](10)not null, [cancelcash][numeric](18,1)not null, [date][date]not null, [time][char](10)not null, [userid][char](10)not null, [status][char](10)not null )on [primary] gocreate table [dbo].[checkday_info]( [remaincash][numeric](18,0)not null, [rechargecash][numeric](18,0)not null, [consumecash][numeric](18,0)not null, [cancelcash][numeric](18,0)not null, [allcash][numeric](18,0)not null, [date][date]not null )on [primary] gocreate table [dbo].[checkweek_info]( [remaincash][numeric](18,0)not null, [rechargecash][numeric](18,0)not null, [consumecash][numeric](18,0)not null, [cancelcash][numeric](18,0)not null, [allcash][numeric](18,0)not null, [date][date]not null )on [primary] gocreate table [dbo].[line_info]( [serial][numeric](18,0)not null, [cardno][char](10)not null, [studentno][char](11)not null, [studentname][char](10)not null, [department][char](10)not null, [sex][char](10)not null, [ondate][date]not null, [ontime][time](0)not null, [offdate][date]not null, [offtime][time](0)not null, [consumetiem][char](10)not null, [consume][numeric](18,1)not null, [cash][numeric](18,1)not null, [status][char](8)not null, [computer][char](10)not null )on [primary] gocreate table [dbo].[online_info]( [cardno][char](10)not null, [cardtype][char](10)not null, [studentno][char](11)not null, [studentname][char](10)not null, [department][char](10)not null, [sex][char](10)not null, [ondate][date]not null, [ontime][time](0)not null, [computer][char](10)not null, [date][datetime2](0)not null )on [primary] gocreate table [dbo].[onwork_info]( [userid][char](10)not null, [level][char](10)not null, [logindate][date]null, [logintime][time](0)null, [computer][char](10)null )on [primary] gocreate table [dbo].[recharge_info]( [serial][numeric](18,0)not null, [studentno][char](11)null, [cardno][char](10)not null, [addmoney][numeric](19,4)not null, [date][date]null, [time][time](0)null, [userid][char](10)null, [status][char](10)null )on [primary] gocreate table [dbo].[student_info]( [cardno][char](10)not null, [studentno][char](11)null, [studentname][char](10)null, [sex][char](6)null, [department][char](10)null, [grade][char](10)null, [class][char](10)null, [cash][numeric](10,3)not null, [explain][varchar](50)null, [userid][char](10)not null, [status][char](10)not null, [ischeck][char](10)not null, [date][date]not null, [time][time](0)not null, [type][char](10)null )on [primary] gocreate table [dbo].[user_info]( [userid][int]not null, [pwd][char](10)null, [level][char](8)null, [username][char](10)null, [head][char](10)null primary key(userid) )on [primary] gocreate table [dbo].[worklog_info]( [serial][numeric](18,0)not null, [userid][char](10)null, [level][char](10)null, [logindate][date]null, [logintime][time](0)null, [logoutdate][date]null, [logouttime][time](0)null, [computer][char](10)null, [status][char](10)not null )on [primary] go




? ? ? ? ?這樣,建立好數據庫之后,分析,執行,建立數據庫沒有任何問題,但是使用的時候回有問題,因為所有的表都是空的,無法登陸使用,除非把主窗體設置為第一個啟動窗體。

?

insert user_info(userid,pwd ) values('1','1')

? ? ? ? ?這段代碼,是指定一個用于登陸的用戶和密碼,學生中也有,否則只能從主窗體啟動。

?

?

?

? ? ? ? ? ?使用自己建立的數據庫是無法登陸到給的機房系統的,一旦登陸就會報錯,就是這個錯誤,而且不是計算機用戶名的問題,具體參照博客:點擊打開鏈接

?

?

?


? ? ? ? ? ? 新建的數據庫只能自己敲的系統使用,給的系統不能使用,初步懷疑,是數據表,其中的字段命名有問題,包括其中的大小寫,自建數據庫中表和字段名全部都使用的小寫,而給的機房打開其中的數據表和字段有的字母都是大寫。
? ? ? ? ? ? 機房給的數據庫中的表和字段的命名有的不規范,精英都是非常優秀的,要成為精英必須要注意這些小的細節,比如命名,從現在就應該掌握正確的命名規范,以后要做的系統還有很多,目前打算把所用的名字都改為給的機房的數據庫的表名和字段名,模擬機房數據庫,把所有的名稱都改成機房的原有的的數據庫名稱。

?

? ? ? ? ? ? 自建數據庫使用一個別名,在自己做的機房收費系統中使用,把給的機房系統和建立的模擬機房數據庫連接上,這樣就可以參考給的機房,做自己的機房,其實,也不用自己建立模擬的機房數據庫,直接連接給的機房數據庫,給的機房就可以運行,然后自己做的機房,給自建的數據庫起個別名就行了。

?

? ? ? ? ? ? 不光要給數據庫起個別名,還必須把里面所有的表都要起個別名,這樣有點就麻煩了,因為,在建立兩個數據庫時,數據庫的名稱不可以一樣,而且,里面所有的表的表名都不可以一樣,如果某個表名一樣的話,后建立的一個數據庫就會把先建立的數據庫中的這個表,即表名相同的表給刪除掉。

?

總結

以上是生活随笔為你收集整理的建立数据库的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。

主站蜘蛛池模板: av免费入口| 熟女肥臀白浆大屁股一区二区 | 一级作爱视频 | 亚洲毛片一级 | 高清久久 | 日韩av不卡在线 | 午夜精品久久久久久久久久久久久蜜桃 | 在线观看免费成人 | 天堂资源| 在线看黄网 | 日本女优中文字幕 | 国产精品福利影院 | 日韩婷婷 | 成年人视频在线播放 | 老熟妇一区二区三区啪啪 | 亚洲不卡在线播放 | 免费的一级黄色片 | 中文字幕一区二区三区精品 | 日本少妇作爱视频 | 亚洲综合免费观看高清完整版 | av免费亚洲 | 欧美日韩精品一区二区三区蜜桃 | 国产69精品麻豆 | 欧美jizzhd精品欧美18 | 亚洲av最新在线网址 | 午夜视频一区二区三区 | 九色福利 | 一区二区视频国产 | 久草色视频 | 日日夜夜噜噜噜 | 日韩欧美手机在线 | 538国产视频 | 又粗又大又硬毛片免费看 | 日韩欧美影院 | 免费特级毛片 | 免费av电影网址 | 久久人妻免费视频 | 欧美日韩操| 四虎影视永久免费 | 性猛交╳xxx乱大交 偷偷操不一样的久久 | 风韵少妇性饥渴推油按摩视频 | 住在隔壁的她动漫免费观看全集下载 | 国产精视频 | 亚洲精品字幕在线 | 精品一区免费 | 亚洲av无码专区在线电影 | 女人性高潮视频 | 免费一区二区 | 国产精品秘 | 成人黄色激情小说 | 在线免费视频一区二区 | 最新91在线 | 国产九九九九 | 一级片免费在线观看 | 成为性瘾网黄的yy对象后 | 日本激情电影 | 日日噜夜夜噜 | 国产一区二区三区在线免费观看 | 蜜桃久久久久久久 | 最新中文在线视频 | 免费不卡av | 色超碰 | 久久无码性爱视频 | 色婷婷免费视频 | 91色噜噜 | 四季av一区二区 | 亚洲日本韩国在线 | 亚洲天堂一二三 | 亚洲精品综合精品自拍 | 99久久婷婷 | 日韩av在线资源 | 91精品国产综合久久久蜜臀图片 | 天美麻花果冻视频大全英文版 | 三级电影在线看 | 最近中文字幕一区二区 | 激情av在线 | 操视频网站 | 爱操在线 | 亚洲一区二区三区四区不卡 | 亚洲精品一区二三区 | 成人乱人乱一区二区三区一级视频 | 精品国产伦一区二区三 | 一级小毛片 | 美女扒开尿口让男人桶 | 毛片视频免费播放 | а√天堂中文在线资源8 | 亚洲永久在线观看 | 巨乳女教师的诱惑 | 少妇呻吟视频 | 久久久久久久国产 | 白又丰满大屁股bbbbb | 亚洲青涩网 | 亚洲影音 | 色性网站 | 蜜桃精品视频在线观看 | 裸体裸乳免费看 | www.美色吧.com | 免费一级特黄3大片视频 | 欧美在线色 |