Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

SQL Server 2008 Unable to resolve table names

Posted on 2011-03-13
5
Medium Priority
?
278 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 1500 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

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

I have written a PowerShell script to "walk" the security structure of each SQL instance to find:         Each Login (Windows or SQL)             * Its Server Roles             * Every database to which the login is mapped             * The associated "Database User" for this …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

916 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