| |

VerySource

 Forgot password?
 Register
Search
View: 830|Reply: 5

May I use the query analyzer to enter select * into # temp1 from (select ...)

[Copy link]

4

Threads

4

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-1-30 00:20:01
| Show all posts |Read mode
In the above statement, when I run it again, I will be prompted that the table # temp1 already exists in the database. How can I delete this temporary table?
thanks
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-3-5 19:15:01
| Show all posts
drop table # temp1
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-3-5 22:30:02
| Show all posts
if (select object_id ('tempdb .. # temp1')) is not null
drop table # temp1
Reply

Use magic Report

0

Threads

211

Posts

108.00

Credits

Newbie

Rank: 1

Credits
108.00

 China

Post time: 2020-3-6 00:00:01
| Show all posts
-Wrong, change

if (object_id ('tempdb .. # temp1') is not null)
drop table # temp1
Reply

Use magic Report

0

Threads

40

Posts

29.00

Credits

Newbie

Rank: 1

Credits
29.00

 China

Post time: 2020-3-7 13:00:02
| Show all posts
drop table # temp1
select * into # temp1 from (select ...)

Just select all of them every time
Reply

Use magic Report

0

Threads

21

Posts

15.00

Credits

Newbie

Rank: 1

Credits
15.00

 China

Post time: 2020-3-7 14:45:02
| Show all posts
# temp1 The table will not be deleted by itself until the end of the program process.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list