简体   繁体   中英

How to Generate script from Temporary table (#temp1) in SQL

I tried to Generate Script From Temporary table , let we say my temp table is temp1 like below

select * into #temp1 from Receiptsandpayments

This #temp1 Table stored in systemDatabase under Tempdb

When I Tried to Generate Script From #temp1, I can't able to Generate Script
Is there any way to Generate Script from #temp Table
please Help me to tackle this issue.....

Temporary tables can only be accessible within the same SQL session. If you want your temporary table to be accessible across multiple sessions you can try creating global temporary tables (add 2 # in the table name):

eg: select * into ##temp1 from Receiptsandpayments

After that, try to run your Generate script again, this time querying ##temp1 instead of #temp1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM