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

sql查詢表結構

發布時間: 2022-07-16 21:30:07

sql表結構怎麼查詢,

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

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

㈡ sql server表結構怎麼查看

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

㈢ 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 = '表名'

㈣ sql 語言中,怎樣查詢表結構如何修改表中欄位的

不同的資料庫、查詢表結構的sql語句是不一樣的,修改表中的欄位用alter
table
tablename
語句吧。。。

㈤ 如何通過sql查看錶的結構

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

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

熱點內容
cryptopythonrsa 發布:2025-08-21 03:36:29 瀏覽:673
androidmandroidn 發布:2025-08-21 03:31:50 瀏覽:210
為什麼不能把安卓桌面app設為默認 發布:2025-08-21 03:22:31 瀏覽:442
愛奇藝會員密碼哪裡設置 發布:2025-08-21 03:11:57 瀏覽:262
電信電話密碼是什麼 發布:2025-08-21 03:08:14 瀏覽:446
sqlserver自動收縮 發布:2025-08-21 03:07:28 瀏覽:685
微信伺服器開哪個地址 發布:2025-08-21 03:06:12 瀏覽:652
diy源碼 發布:2025-08-21 02:42:36 瀏覽:480
信息存儲與信息檢索 發布:2025-08-21 02:22:32 瀏覽:122
android非同步數據載入數據 發布:2025-08-21 02:09:33 瀏覽:245