国产一级a片免费看高清,亚洲熟女中文字幕在线视频,黄三级高清在线播放,免费黄色视频在线看

打開APP
userphoto
未登錄

開通VIP,暢享免費電子書等14項超值服

開通VIP
幾個常用的sql server系統(tǒng)表的使用

--查看表的屬性
select * from sysObjects where [Name] = 'section'
--用法
if exists ( select * from sysObjects where [Name] = 'section'  and xtype='U' )
    Drop Table table1
  go
Create table1 ( )

--獲取所有用戶表
select Name from sysobjects where xtype='u' and status>=0

--查看表的字段
select * from  sysColumns c where c.id=object_id('section')
select name from syscolumns where id=object_id('表名')
 
--查看用戶
select * From  sysusers where status<>0

--查看誰引用了bbs_hits表(包括視圖、存儲過程、函數(shù))
Select distinct object_name(d.id) as 'program',
       o.xtype
  from sysdepends d inner join sysobjects o on d.id=o.id
  where object_name(depid)='bbs_hits'

--查看與某一個表相關(guān)的視圖、存儲過程、函數(shù)
  select a.* from sysobjects a, syscomments b where a.id = b.id and b.text like '%表名%'

--查看當前數(shù)據(jù)庫中所有存儲過程
select name as 存儲過程名稱 from sysobjects where xtype='P'

--查詢某一個表的字段和數(shù)據(jù)類型
select column_name,data_type from information_schema.columns
where table_name = '表名'
[n].[標題]:
Select * From TableName Order By CustomerName

其中xtype分別對應(yīng):

C = CHECK 約束
D = 默認值或 DEFAULT 約束
F = FOREIGN KEY 約束
FN = 標量函數(shù)
IF = 內(nèi)嵌表函數(shù)
K = PRIMARY KEY 或 UNIQUE 約束
L = 日志
P = 存儲過程
R = 規(guī)則
RF = 復(fù)制篩選存儲過程
S = 系統(tǒng)表
TF = 表函數(shù)
TR = 觸發(fā)器
U = 用戶表
V = 視圖
X = 擴展存儲過程

本站僅提供存儲服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點擊舉報
打開APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
SQL Server判斷對象是否存在 (if exists (select * from sysobjects )(轉(zhuǎn))
sql語句判斷各種資源是否存在示例
MSSQL中3個主要系統(tǒng)對象 sysdatabases、 sysobjects、 syscolumns
關(guān)于數(shù)據(jù)庫服務(wù)器操作
sql server2005 存儲數(shù)據(jù)庫表名、字段名、描述的數(shù)據(jù)庫表和sql語句
刪除數(shù)據(jù)庫所有存儲過程的SQL語句
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長圖 關(guān)注 下載文章
綁定賬號成功
后續(xù)可登錄賬號暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點擊這里聯(lián)系客服!

聯(lián)系客服