简体   繁体   English

无效的对象名称错误?

[英]Invalid Object name error?

I have this stored procedure that import an excel file then by using queries it create the reports that I want then it export the tables that were created by them. 我有这个存储过程导入excel文件,然后使用查询创建我想要的报表然后导出由他们创建的表。

the problem is that when I import the excel file the rest of the code doesn't see the table that was imported and I have to refresh my database to see the imported table. 问题是,当我导入excel文件时,其余代码没有看到导入的表,我必须刷新我的数据库才能看到导入的表。

在此输入图像描述

well as you can see the job that import the file works fine, but the rest of code can not see the table. 以及你可以看到导入文件的工作正常,但其余的代码无法看到表。

Is there any way to fix this problem? 有什么方法可以解决这个问题吗?

Try with the below method. 尝试使用以下方法。

Inside the procedure ,change the TableName to 3 part as '[database name].dbo.[tablename]. 在过程中,将TableName更改为3部分为'[数据库名称] .dbo。[tablename]。

Say if the table [New LP] is created in the database abc,change the table name inside the procedure as [abc].dbo.[New LP]. 假设在数据库abc中创建了表[New LP],将过程中的表名更改为[abc] .dbo。[New LP]。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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