我想知道#temp_table 和 user.#temp_table 之间有什么区别
-- 1) #Tem_table
create table #temp_table
( id integer null);
select * from #temp_table -- find
select * from sysobjects where name = '#temp_table'-- not found
-- 关闭我的客户端
select * from #temp_table -- not found
--2) user.#temp_table
create table user.#temp_table
( id integer null);
select * from user.#temp_table -- found
select * from sysobjects where name = '#temp_table' -- found
-- 关闭我的客户端
select * from sysobjects where name = '#temp_table' -- still exist
我的主要问题是,为什么
select * from sysobjects where name = '#temp_table'
不返回任何内容,并返回给用户。
select * from sysobjects where name = '#temp_table'
返回信息。
最佳答案
当您添加 user_name.#Table_name 时,Sybase 会自动忽略 #。您创建的是普通用户表。事实上,如果你检查它
select * from sysobjects where name = '#temp_table'
类型应该是“U”,这意味着您创建了一个用户表 = 根本不是临时表。
最好的问候,恩里克
关于sql - #temp_table 与用户。#temp_table sybase_iq,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47096911/