我实际上是在数据库中删除一个临时表。仅当数据库中存在它时,我才必须删除它。请让我知道如何检查数据库中是否存在表。
最佳答案
if object_id('tempdb..#myTempTable') is not null
drop table #myTempTable
关于sql - 如何检查数据库中是否存在临时表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/581427/
我实际上是在数据库中删除一个临时表。仅当数据库中存在它时,我才必须删除它。请让我知道如何检查数据库中是否存在表。
最佳答案
if object_id('tempdb..#myTempTable') is not null
drop table #myTempTable
关于sql - 如何检查数据库中是否存在临时表,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/581427/