查询SQL Server 2012数据库时出现初始错误 [英] Initial error when querying SQL Server 2012 database
问题描述
使用SQL Server 2012,我创建了一个数据库和一个表:
Using SQL Server 2012, I created a database and a table:
当我第一次使用该查询(在连接到SQL Server之后)查询表时:
When I query the table the first time (after I connect to SQL Server) using this query:
select *
from [dbo].[Downloads]
我知道了
Msg 2809,第16级,状态1,第1行
对过程下载的请求失败,因为下载是一个表对象。
Msg 2809, Level 16, State 1, Line 1
The request for procedure 'Downloads' failed because 'Downloads' is a table object.
但是第二次我执行相同的 SELECT
语句,它可以正确运行
But the second time I execute the same SELECT
statement, it runs correctly
如何在第一次消除这种错误?
How do I eliminate this error the first time around?
推荐答案
您在Management Studio中选择了文本 Downloads
。这将导致执行T-SQL字符串 Downloads
。这样的T-SQL批处理被解释为过程调用。
You had the text Downloads
selected in Management Studio. This causes the T-SQL string Downloads
to be executed. Such a T-SQL batch is interpreted as a procedure call.
这篇关于查询SQL Server 2012数据库时出现初始错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!