---
title: "sqlserver删除临时表"
author: "harbey"
date: "2009-05-19T10:39:37Z"
tags: []
slug: "sqlserver"
draft: false
lastmod: "2009-05-19T10:39:37Z"
id: 390976
url: "https://harbey.iteye.com/blog/390976"
---

--删除临时表
if object_id('tempdb..#tempTable') is not null Begin
    drop table #tempTable
End

其中object_id('tempdb..#tempTable')只修改#tempTable为要删除的临时表