Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Initial error when querying SQL Server 2012 database

Using SQL Server 2012, I created a database and a table:

enter image description here

When I query the table the first time (after I connect to SQL Server) using this query:

select * 
from [dbo].[Downloads]

I get

Msg 2809, Level 16, State 1, Line 1
The request for procedure 'Downloads' failed because 'Downloads' is a table object.

But the second time I execute the same SELECT statement, it runs correctly

How do I eliminate this error the first time around?

like image 287
Glowie Avatar asked Aug 12 '14 17:08

Glowie


People also ask

What is the error in SQL query?

The most common SQL error is a syntax error. What does syntax mean? Basically, it means a set arrangement of words and commands. If you use improper syntax, the database does not know what you're trying to tell it.


1 Answers

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.

like image 139
usr Avatar answered Sep 21 '22 02:09

usr