當前位置:首頁 » 編程語言 » 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查詢系統元數據

熱點內容
qml文件修改後編譯未生效 發布:2025-05-14 07:31:00 瀏覽:329
內到內演算法 發布:2025-05-14 07:29:11 瀏覽:33
文件夾名字不顯示 發布:2025-05-14 07:27:47 瀏覽:774
oracle的資料庫驅動jar 發布:2025-05-14 07:23:20 瀏覽:555
我的世界電腦版伺服器手機版能進嗎 發布:2025-05-14 07:22:01 瀏覽:678
達內培訓php多少錢 發布:2025-05-14 07:19:10 瀏覽:26
python位元組轉字元串 發布:2025-05-14 07:06:35 瀏覽:421
subplotpython 發布:2025-05-14 06:53:51 瀏覽:661
豎屏大屏導航工廠密碼一般是多少 發布:2025-05-14 06:49:29 瀏覽:806
如何在手機里設置無線網密碼 發布:2025-05-14 06:47:54 瀏覽:120