Solved

SQL Server 2008 Unable to resolve table names

Posted on 2011-03-13
5
270 Views
Last Modified: 2012-05-11

We've upgraded our database from 2000 to 2008 (using this method in case it's important: http://msdn.microsoft.com/en-us/library/ms189625.aspx).  

We are now testing this and are having a problem with resolving table names from our .NET website.  Using Enterprise Mgr I've verified that the tables are there.  Plus if I use the schema/owner name and the table name it works.

This works:
       "select *, C.ClientName FROM portal.UserTable U"

For the user I'm using to connect to the database the default schema is set to 'portal' when I check that user's properties, but that doesn't seem to make a difference.

Our system is full of non-fully qualified names, so I would really like to figure out how to get the default to work so I don't have to go through the entire system and make changes to the table names in the queries.

Thanks for the help.
0
Comment
Question by:hzuker44
  • 3
5 Comments
 
LVL 28

Expert Comment

by:Ryan McCauley
ID: 35124760
What's the exact error you receive when you "can't resolve the name" - something like "object does not exist"? The exact message will help the troubleshooting immensely.
0
 

Author Comment

by:hzuker44
ID: 35124776
When I execute the query:

    "select * FROM UserTable U"


The resulting error message is:

    Invalid object name 'UserTable'.
0
 
LVL 11

Accepted Solution

by:
JoeNuvo earned 500 total points
ID: 35125010
you might need to consider change the table schema to be 'dbo' instead of 'Portal'

http://blogs.x2line.com/al/articles/155.aspx
0
 

Author Comment

by:hzuker44
ID: 35125205
Well this solution works for us.  But it would still be nice to know why the default schmea setting didn't worked.

Thanks
0
 

Author Closing Comment

by:hzuker44
ID: 35125213
It solved the problem.  It did work around our issue so we didn't have to fix the source of the problem.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

There have been several questions about Large Transaction Log Files in SQL Server 2008, and how to get rid of them when disk space has become critical. This article will explain how to disable full recovery and implement simple recovery that carries…
Naughty Me. While I was changing the database name from DB1 to DB_PROD1 (yep it's not real database name ^v^), I changed the database name and notified my application fellows that I did it. They turn on the application, and everything is working. A …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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