我正在研究如何在SQL Server中创建临时表。我成功地创建了临时表,但当我尝试查看数据时,它显示“无效对象名称”。 请问临时表存在多长时间? 如果我使用用户名为devloper,密码为0999登录到SQL Server,同时有其他人也使用相同的凭据登录到SQL Server,那么这个临时表会被删除吗? 以下是我的SQL语句:
SELECT net_node_model.SYS_ID, net_node_model.NODE, mst_temp_equation.TEMP_ID,
mst_temp_equation.EQ_ID
INTO ##NT_MASTER_TEMP_EQUATION
FROM mst_temp_equation INNER JOIN
net_node_model ON mst_temp_equation.TEMP_ID = net_node_model.TEMP_ID
GROUP BY net_node_model.SYS_ID, net_node_model.NODE, mst_temp_equation.TEMP_ID,
mst_temp_equation.EQ_ID, mst_temp_equation.EQ_NAME,
mst_temp_equation.EQ_TYPE, mst_temp_equation.[OBJECT],
mst_temp_equation.VAR_TYPE, mst_temp_equation.VAR_NAME,
mst_temp_equation.VAR_SUBSET, mst_temp_equation.VAR_SET,
mst_temp_equation.RHS_RELN, mst_temp_equation.RHS_OBJECT,
mst_temp_equation.RHS_VAR_SET, mst_temp_equation.RHS_VAR_SUBSET,
mst_temp_equation.RHS_VAR_TYPE, mst_temp_equation.RHS_VAR_NAME,
mst_temp_equation.EQ_TP_OFFSET, mst_temp_equation.RHS_TP_OFFSET,
mst_temp_equation.RETAIN, mst_temp_equation.TIME_PRD,
mst_temp_equation.EQ_VAR_SUBTYPE, mst_temp_equation.RHS_VAR_SUBTYE;