Showing all posts tagged #sql:


在 SQL Server 2005 中取得所有欄位定義的方法(含備註欄位)

Posted on June 5th, 2014



SQL 這個算超好用的... 如果要請客戶幫忙 debug

結果會把所有 table 以及各個欄位的資訊放在一起輸出


REF: [The Will Will Web](http://blog.miniasp.com/post/2007/11/05/How-to-get-detailed-Data-Dictionary-in-SQL-Server-2005.aspx)



sql指令取得table內的欄位名稱

Posted on June 5th, 2014

###MSSQL
``select name from syscolumns where id=object_id('tablename')``

###Oracle
```
select COLUMN_NAME from all_tab_columns
where owner='OWNER' --需要大寫,否則找不到
and table_name='DIS_PHON_ACC' --需要大寫,否則找不到
order by column_id
```

REF: [sql指令取得table內的欄位名稱](http://blog.roodo.com/fionscenery/archives/19070448.html)

Liullen

Notes from my experience.