1.查詢某個表被哪些儲存過程(以下簡稱 sp)使用到 :
select distinct object_name(id) from syscomments where id in
(select object_id from sys.objects where type ='p') and text like'%tablename%'
2.查詢那些過程對該錶做了更新操作:
select distinct object_name(id) from syscomments where id in
(select object_id from sys.objects where type ='p') and text like'%update tablename%'
3.查詢當前資料庫中所有sp:
select name as 儲存過程 from sysobjects where type = 'p'
sql server 查詢某個表在哪些儲存過程(sp)中使用
1.查詢某個表被哪些儲存過程(以下簡稱 sp)使用到 :
select distinct object_name(id) from syscomments where id in
(select object_id from sys.objects where type ='p') and text like'%tablename%'
2.查詢那些過程對該錶做了更新操作:
select distinct object_name(id) from syscomments where id in
(select object_id from sys.objects where type ='p') and text like'%update tablename%'
儲存過程系列之儲存過程sql查詢儲存過程的使用
1.查詢某個表被哪些儲存過程 以下簡稱 sp 使用到 select distinct object name id from syscomments where id in select object id from sys.objects where type p and text like ta...
SQL之儲存過程
定義變數 declare a int 變數賦值 set a 1 print a 變數結合查詢語句 不跟菠蘿乙個產地的水果資訊 select from fruit where source not in select source from fruit where name 菠蘿 declare so...
SQL儲存過程
什麼是儲存過程呢?定義 將常用的或很複雜的工作,預先用sql語句寫好並用乙個指定的名稱儲存起來,那麼以後要叫資料庫提供與已定義好的儲存過程的功能相同的服務時,只需呼叫execute,即可自動完成命令。講到這裡,可能有人要問 這麼說儲存過程就是一堆sql語句而已啊?microsoft公司為什麼還要新增...