Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 SQL Server 2005。在那台服务器上我有 3 个数据库 -> a、b、c。
如果我想删除表
试试这个:
USE C GO SELECT 'DROP TABLE ' + name FROM sys.tables WHERE create_date >= '20101211' -- substitute your date you're interested in AND name like 'bkp%'
这将创建一个语句列表作为输出DROP TABLE:....- 将它们复制并粘贴到新的 SSMS 窗口中并执行它们 - 你就完成了!
DROP TABLE:....