我正在使用SQL Server 2008.我有一個數據庫Training
,其中包含兩種類型的存儲過程,其名稱前綴爲SP_V400_
和spV400_
。現在我需要刪除名稱前綴爲spV400_
的存儲過程。如何在一個數據庫中刪除多個存儲過程
我試過這個命令
SELECT 'DROP PROCEDURE [' + SCHEMA_NAME(p.schema_id) + '].[' + p.NAME + '] GO'
FROM sys.procedures p
WHERE p.name LIKE '%spV400%'
ORDER BY p.name
但我得到一個錯誤:
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near 'GO'.
http://www.devasp.net/net/articles/display/309.html – Dhaval 2014-11-25 04:35:49
USE spV400%NOT%spV400%。 – Veera 2014-11-25 04:36:52