查詢使用者儲存過程名 ,具體資訊,表說明和列說明

2021-06-21 22:40:06 字數 1150 閱讀 7730

1、查詢使用者儲存過程名:

select name, owner = user_name(uid), objtype = power(2,sysstat & 0xf) from sysobjects where (power(2, sysstat & 0xf) & 253 <> 0) and not ((objectproperty(id, n'isdefaultcnst') = 1) and (category & 0x0800 <> 0)) and (objectproperty(id, n'ismsshipped') <> 1 and (name not like n'#%')) and power(2,sysstat & 0xf) = 16  order by name, owner

2、根據儲存過程名,通過結構同以下sql語句依次獲取使用者儲存過程指令碼資訊:

if exists (select * from dbo.syscomments where id=object_id(n'[dbo].[yyy]'))

select c.text, c.encrypted, c.number, xtype=convert(nchar(2), o.xtype),     datalength(c.text), convert(varbinary(8000), c.text), 0 from dbo.syscomments c, dbo.sysobjects o     where o.id = c.id and c.id = object_id(n'[dbo].[yyy]') order by c.number, c.colid

其中dbo.yyy是儲存過程名字。

3)列說明說明

execute   sp_addextendedproperty   n'ms_description',   '測試',   n'user',   n'dbo',   n'table',   n'temp1',   n'column',   n'deptid'

其中測試時要新增的說明字元,temp1是表名稱,deptid

4)表說明

execute   sp_addextendedproperty   n'ms_description',   '測試',   n'user',   n'dbo',   n'table',   n'temp1',  null,   null

其中測試時要新增的說明字元,temp1是表名稱。

通過儲存過程 查詢表資訊

region 查詢 獲取裝置列表 翻頁引數 裝置編號 裝置名稱 裝置sn號 裝置狀態 溫度 濕度 電壓 訊號 通訊方式 空字串為忽略 分配情況 0為未分配,1為分配 分配物件 最後更新時間 建立時間 裝置資訊列表 datatable public datatable getequipmentslis...

sql server 查詢表名,儲存過程,列名等

1 獲取當前資料庫中的所有使用者表 select name from sysobjects where xtype u and status 0 2 獲取某乙個表的所有字段 select name from syscolumns where id object id n 表名 select a.fr...

儲存過程動態表名

create or replace procedure bxsp data qb startdate in varchar2,開始日期 enddate in varchar2,結束日期 feetype in varchar2,費用型別 procesnode in varchar2,流程節點 audi...