Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Determine whether the temporary table exists and delete it if it exists.

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

-- take the temporary table # temp as an example to determine whether it exists or not. Delete it if it exists. Delete it IF OBJECT_ID ('tempdb..#temp') is not nulldrop table # temp-- method-1if exists (select * from tempdb.dbo.sysobjects where id = object_id (Numbertempdb.. tempcitys') and type='U') 2 drop table # tempcitys-- method Diif object_id (' tempdb..#tem') is not null begin print 'exists' end else begin print' not exists' end

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report