201008201218SQL 小技巧

慢慢寫,記起來下次就不用找半天...


  • 計算使用者年齡
DATEDIFF(yy, 你的欄位, getdate()) as 年齡
  • 找出某資料庫內所有使用者的「資料表」(Table)名稱
select name from sysobjects where xtype='U' order by 1
  • 找出某資料庫內所有使用者的「檢視表」(View)名稱
select name from sysobjects where xtype='V' order by 1

 

回應
Google Search
Google
平均分數:0 顆星
投票人數:0
我要評分:
Google