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

熱點內容
java返回this 發布:2025-10-20 08:28:16 瀏覽:705
製作腳本網站 發布:2025-10-20 08:17:34 瀏覽:968
python中的init方法 發布:2025-10-20 08:17:33 瀏覽:676
圖案密碼什麼意思 發布:2025-10-20 08:16:56 瀏覽:828
怎麼清理微信視頻緩存 發布:2025-10-20 08:12:37 瀏覽:737
c語言編譯器怎麼看執行過程 發布:2025-10-20 08:00:32 瀏覽:1076
郵箱如何填寫發信伺服器 發布:2025-10-20 07:45:27 瀏覽:308
shell腳本入門案例 發布:2025-10-20 07:44:45 瀏覽:188
怎麼上傳照片瀏覽上傳 發布:2025-10-20 07:44:03 瀏覽:875
python股票數據獲取 發布:2025-10-20 07:39:44 瀏覽:829