我尝试从临时表生成脚本,假设我的临时表是 temp1 如下所示
select * into #temp1 from Receiptsandpayments
这个 #temp1 表存储在 tempdb 下的 systemDatabase 中
当我尝试从#temp1 生成脚本时,无法生成脚本
有没有办法从#temp 表生成脚本
请帮助我解决这个问题......
最佳答案
临时表只能在同一 SQL session 中访问。如果您希望您的临时表可以跨多个 session 访问,您可以尝试创建全局临时表(在表名中添加 2 #):
例如:从 Receiptsandpayments 中选择 * into ##temp1
之后,尝试再次运行生成脚本,这次查询##temp1 而不是#temp1。
关于mysql - 如何从 SQL 中的临时表 (#temp1) 生成脚本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43199434/