?
Solved

Server: Msg 208, Level 16, State 1, Line 1

Posted on 2009-04-17
21
Medium Priority
?
1,119 Views
Last Modified: 2012-05-06
Expert,

I created a table (aa), then I loaded data into this aa table, after data loading, I couldn't select data from QA, it gave error like:
Server: Msg 208, Level 16, State 1, Line 1
I can see my data in EM fpr aa table data return.  I could select data in the same db different tables, but I couldn't select table aa
Thank you for the help.
0
Comment
Question by:yrcdba7
  • 8
  • 7
  • 4
  • +1
21 Comments
 
LVL 5

Expert Comment

by:Aanvik
ID: 24172190
Can you provide the query you are using?
0
 

Author Comment

by:yrcdba7
ID: 24172309
sleect * from aa
0
 

Author Comment

by:yrcdba7
ID: 24172315
select * from dbname.aa

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbname.aa'.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Expert Comment

by:Aanvik
ID: 24172316
SELECT * FROM AA

Copy paste this and it should fix it... There was a typo in select..
0
 
LVL 5

Expert Comment

by:Aanvik
ID: 24172320
select * from dbname.dbo,aa

try this.


0
 
LVL 5

Expert Comment

by:Aanvik
ID: 24172322
select * from dbname.dbo.aa
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24172831
Or simply
select * from dbname..aa
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24172836
Another possibility is making sure you are on the right db.
use dbname
select * from aa
0
 

Author Comment

by:yrcdba7
ID: 24176002
Expert,
This is a very Urgent question, I need to count data then send infor out, I couldn't now.

I tried this it still gave me a error,

select * from dbname.dbo.aa

output error is:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbname.dbo.AA.

I know it is sample, my typing is 100% correct, but it still give me this error.

0
 
LVL 41

Expert Comment

by:ralmada
ID: 24176638
Have you tried my suggestion?

select * from dbname..aa
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24178094
there may be a rights issue with the user you are using to get login to your DB or you are not using proper schema.

Please check which schema your table is using with following query.

select t.name,s.name from sys.tables t join sys.schemas s on t.schema_id=s.schema_id

if you table AA don't have DBO schema than use following query

select * from <dbname>.<schemaName>.aa

or

select * from <schemaName>.aa

if this will not work than given permission on AA table to your user which you are using. with following command.

USE AdventureWorks;
GRANT all ON <schemaName>.aa   TO <userName>;


0
 

Author Comment

by:yrcdba7
ID: 24197706

Expert,

I ran your select by select t.name,s.name from sys.tables t join sys.schemas s on t.schema_id=s.schema_id
it showed me this error:
Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'sys.tables'.
Which database I should use to run this select. I used master, it had error then I use database name it has the same error.

How can I my database table schema name?
select * from <dbname>.<schemaName>.aa

You know my dbname is KKMM, schemaName? I don't know, its owner is dbo
Thank you for your help.
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24198940
Another way to check the schema is with this query:
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM KKMM.INFORMATION_SCHEMA.Tables
WHERE TABLE_NAME = N'aa';
GO
Also it is possiblbe that you are using Case Sensitive collation. So check your spelling.
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24201230
Sorry the query should beL
SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM KKMM.INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = N'aa';
GO
 
Another way to check the schema is by checking in object explorer. The first part is the schema. See image attached.
And don't forget about the case sensitive collation.

object-explorer.jpg
0
 
LVL 41

Expert Comment

by:ralmada
ID: 24201237
So for instance for table Address, the schema is Person, so when you query it you should do
use AdventureWorks
select * from Person.Address
0
 

Author Comment

by:yrcdba7
ID: 24216136

Expert,

I used your this query but nothing queried out. it is empty table.

SELECT TABLE_CATALOG, TABLE_SCHEMA, TABLE_NAME
FROM KKMM.INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = N'aa';
GO

Then I went to EM to see that table aa, I saw it is dbo.aa
so my table schema is dbo.  I used select to retreive data like

select * from dbo.aa
it still gave me the same error like:

Server: Msg 208, Level 16, State 1, Line 1
Invalid object name 'dbo.aa'.

any other idear?  Please!!


 
0
 
LVL 31

Expert Comment

by:RiteshShah
ID: 24216163
which id/pass you are using to get connection to sql server? may be the user you are using, don't have rights on your talbe.
0
 

Author Comment

by:yrcdba7
ID: 24216295

I checked permission for this database, I have system admin permission.
I can see the table schema is dbo.aa.  so frustrate for this.
0
 

Author Comment

by:yrcdba7
ID: 24217047
I also tried to use sa login, then open query analyze, select * from dbname.aa
it showed me the same error.

I used my sql server authentication login with system admin permissioin which I can be sure.  I used this login I can select others tables in the same database.
0
 
LVL 41

Accepted Solution

by:
ralmada earned 2000 total points
ID: 24220768
Try like this: select * from dbname..aa (two consecutive points)
If not, can you drop the table and create it again?
drop table aa
 
0
 

Author Comment

by:yrcdba7
ID: 24252876

Expert,

yes, I droped table then create it again. it works.

Thank you so so much.

Tina
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Suggested Courses

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question