sp_server_info 可以取得 SQL Server 伺服器的相關屬性。例如:
- 資料表名稱 最大長度
- 例如:128
- 資料行名稱 最大長度
- 例如:128
- 伺服器的字元集排序
- 例如:charset=cp950 collation=Chinese_Taiwan_Stroke_BIN
sp_server_info
傳回 SQL Server、資料庫閘道或基礎資料來源的屬性名稱和相符值的清單。
示範版本
SQL Server 2016
範例01:sp_server_info 列出全部的屬性
-- 01-sp_server_info-Lists all the attribute values USE master GO EXEC sp_server_info GO
-- 01_sp_server_info-Lists all the attribute values

範例02:sp_server_info 列出指定的屬性
-- 02-sp_server_info-Lists the specified attribute values -- sp_server_info - attribute_id is int data type USE master GO EXEC sp_server_info 2 GO
-- 02_sp_server_info 列出指定的屬性

參考資料
sp_server_info (Transact-SQL)
https://technet.microsoft.com/en-us/library/ms176094(v=sql.110).aspx
sp_server_info (Transact-SQL)
https://technet.microsoft.com/zh-tw/library/ms176094(v=sql.110).aspx
沒有留言:
張貼留言