Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Msg 208 1

Status
Not open for further replies.

DennisM3

Programmer
Aug 21, 2003
7
US
Hi,
I'm new to SQL Server programming. Trying to run a query just to get a feel how this thing runs.
I went to SQL Query Analyzer, picked my SQL Server (machine name) and finaly type the following in the Query Design box: "SELECT * FROM RTUC;" I parsed it and parsed okay, when I run it I get the following error:"Server Msg 208, Level 16, State 1, Line 1 Invalid object name RTUC"
RTUC is the name of one of my tables. I also tried going to access, made a query there, Clicked on SQL View and copied the following code from there, but still same results: "SELECT RTUC.STATION FROM STUC".
Anyone knows anything about this?? thanks in advaced!!
Dennis
 
Usually you get that error because you are querying the wrong database.

At the top of Query Analyzer, there's a drop down text box that lets you choose your database. Make sure it's correct.

Also, you can include this in your scripts to ensure the correct database is used:

USE database_name
GO
SELECT *
FROM RTUC

By the way, you don't need the semi-colon and that also might be causing the problem.

-SQLBill
 
Ohh man.. I dont know how I missed that!!
Thank you soo much that fixed the problem!!
Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top