當前位置:首頁 » 編程語言 » sql顯示表結構

sql顯示表結構

發布時間: 2023-07-12 03:04:28

1. DB2 如何用sql語句查看錶結構

1、 select * from sysibm.syscolumns where tbname = < table name>
或者
2、describe select * from <table name>

2. sql表結構怎麼查詢,

加入你的表的名字是 T_tmp,用下面的語句就可以得到你的表結構

select * from syscolumns where id=(select id from sysobjects where name='T_tmp')

3. sql server表結構怎麼查看

在SQL企業管理器或查詢分析器中,選擇要查看的表格,選擇滑鼠右鍵菜單的 「設計表」

4. 如何通過sql查看錶的結構

在查詢分析器中用SQL語句
可輸入以下編碼進行查看
1.
sp_help
tablename
(tablename是你要查看錶結構的表名)
2.
select
*
from
information_schema.columns
where
table_name=你要查的表名
3.
初級:使用管理工具SSMS

右側對象樹展開即可
4.
中級:sp_HelpText
表名
5.
高級:用SQL查詢系統元數據

5. oracle怎麼通過sql查看錶的結構

分兩種方法:

1、在命令窗口通過如下語句:

desc表名;

6. 如何通過SQL查詢獲得資料庫表結構

在菜單 Tools 下面有個 Object browser 將其打勾(如果已經打勾了就不用管了)之後缺慶在IDE的左邊有個Objects窗口,其中有一個樹型結構圖,在裡面找到Tables 展開就可以了看伏櫻握到所有的Table了默認顯示的表包括系統表和許可權允許范圍內的其他schema下的表,如果不想看到,只需將樹型圖上方頌凱的All objects(下拉選框)改為My objects 就只看自己的表了

7. 如何通過sql 查看錶的結構

在查詢分析器察凱陵中用孫雀SQL語句

8. sql server怎麼查看錶結構

SQL Server查詢表結構語句

--1:獲取當前資料庫中的所有用戶表 www.2cto.com
select Name from sysobjects where xtype='u' and status>=0
--2:獲取某一個表的所有欄位
select name from syscolumns where id=object_id('表名')
--3:查看與某一個表相關的視圖、存儲過程、函數
select a.* from sysobjects a, syscomments b where a.id = b.id and b.text like '%表名%'

--4:查看當前資料庫中所有存儲過程
select name as 存儲過程名稱 from sysobjects where xtype='P'
--5:查詢用戶創建的所有資料庫
select * from master..sysdatabases D where sid not in(select sid from master..syslogins where name='sa')
或者
select dbid, name AS DB_NAME from master..sysdatabases where sid <> 0x01

--6:查詢某一個表的欄位和數據類型
select column_name,data_type from information_schema.columns
where table_name = '表名'

9. oracle中,如何利用sql語句查詢某個表的結構

利用sql語句查詢某個表的結構的方法:

通過Oracle中的user_tab_cols, user_col_comments, user_constraints, user_cons_columns表聯合查詢。
1、user_tab_cols用來獲取對應用戶表的列信息;
2、user_col_comments用來獲取對應用戶表列的注釋信息;
3、user_constraints用來獲取用戶表的約束條件;
4、user_cons_columns約束中用戶可訪問列。

示例代碼:

selectt.table_name,
t.column_name,
t.data_type,
t.data_length,
t.nullable,
t.column_id,
c.comments,
(SELECTCASE
WHENt.column_name=m.column_nameTHEN
1
ELSE
0
END
FROMDUAL)iskey
FROMuser_tab_colst,
user_col_commentsc,
(selectm.column_name
fromuser_constraintss,user_cons_columnsm
wherelower(m.table_name)='qh_outstoresabinfo'
andm.table_name=s.table_name
andm.constraint_name=s.constraint_name
ands.constraint_type='P')m
WHERElower(t.table_name)='qh_outstoresabinfo'
andc.table_name=t.table_name
andc.column_name=t.column_name
andt.hidden_column='NO'
orderbyt.column_id
熱點內容
php網頁列印 發布:2025-02-08 23:40:02 瀏覽:820
windowssmb無法訪問 發布:2025-02-08 23:33:28 瀏覽:467
python27編譯器 發布:2025-02-08 23:29:20 瀏覽:339
如何運行python代碼 發布:2025-02-08 23:28:15 瀏覽:692
新箱子密碼鎖怎麼設置 發布:2025-02-08 23:26:50 瀏覽:148
安卓如何可以看見被撤回的消息 發布:2025-02-08 23:19:17 瀏覽:798
火影忍者競技場腳本 發布:2025-02-08 23:10:18 瀏覽:935
英國訪問學者簽證費用 發布:2025-02-08 23:04:46 瀏覽:927
洛奇合成腳本 發布:2025-02-08 22:57:04 瀏覽:142
linux文件軟鏈接 發布:2025-02-08 22:35:48 瀏覽:774