Sqlserver problem -- table not available

S

Shelly

I am a wealth of problems :). Here is the latest. I am running sqlserver
management studio express. I created four tables - Company, Agent, Orders
and Managers. All have/had data.

I coded in visual web developer 2008 express. I had a page that worked
pulling/putting data from/to the Agent table. I did nothing to change that
page.

I am working on another page where I needed both the Agent and Order
database info. I did a sql statement for it and it failed. So, I went to
the sqlserver manager and it failed there as well. Then I tried to build it
in querybuilder in that app. It turns out that I only had Company and
Orders tables available in the querybuilder, but the list of tables under
that database shows all of them.

I then went and tried the working page, and now it fails (because it can't
access table Agent).

I am VERY new to sqlserver, so I don't know where to look to see where Agent
is different from Company in the settings (not the columns)?

Does anyone have a clue as to where I should start looking to have all the
tables available?
 
S

Shelly

When I executed the query:

select name from apcourier..sysobjects where xtype = 'U';

all the tables, including Agent, appeared in the result window. However,
when I did the query

select* from Agent

the following error appeared.

Msg 208, Level 16, State 1, Line 3

Invalid object name 'Agent'.
 
M

Mike

can you open the Agent table in SQL Server Management Studio?
Can you do a right click on the table --> script table as -- > select

and see how SQL creates the select statement






Shelly said:
When I executed the query:

select name from apcourier..sysobjects where xtype = 'U';

all the tables, including Agent, appeared in the result window. However,
when I did the query

select* from Agent

the following error appeared.

Msg 208, Level 16, State 1, Line 3

Invalid object name 'Agent'.
 
S

Shelly

Mike said:
can you open the Agent table in SQL Server Management Studio?
Can you do a right click on the table --> script table as -- > select

and see how SQL creates the select statement

Yes, that works. It gave all the entries in the Agent table when I executed
the query. In fact, if I change the query in that window to select * from
Agent, that works as well.



 
S

Shelly

Shelly said:
Yes, that works. It gave all the entries in the Agent table when I
executed the query. In fact, if I change the query in that window to
select * from Agent, that works as well.

I did NOTHING, and now all the tables are showing up in the query editor.
Also, the query I used in the page, when I cut and paste it into the sql
window, and execute also works fine. I am still having a problem of having
it work in the page. I will work on that.

I have NO idea why the tables suddenly showed up.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,143
Latest member
DewittMill
Top