2009年4月14日 星期二

SQL系統資料

/*檢視表,預存程序內容*/
EXEC sp_helptext 'PDL_LotNumHis'

/*系統物件LIST*/
select * from sys.objects where name LIKE 'SA%' and type='U' order by name

/*資料表LIST*/
select name from sys.tables

/*檢視表LIST*/
select name from sys.views

/*TABLE欄位LIST*/
select cast(c.name as varchar(40)),convert(varchar(40),s.name),* from sys.columns c inner join sys.objects s on c.object_id=s.object_id
where s.name='UTA_MakStrList'

/*COLUMN欄位LIST*/

select c.name,s.name,* from sys.columns c inner join sys.objects s on c.object_id=s.object_id
where c.name='DpMethodName'

沒有留言: