Showing posts with label objects. Show all posts
Showing posts with label objects. Show all posts

Thursday, March 8, 2012

cannot list tables or other objects

Sometimes, when a try to list tables or view (or access Management, etc) Enterprise Manager hungs up.
Using SELECT * FROM SYSOBECTS also freezes the process. But the SQLServer is operational for data updates and retrieves.
Anyone?
thanx!SYSOBJECTS along with SYSINDEXES, SYSPROTECTS, SYSDEPENDS, SYSCOLUMNS, and SYSCOMMENTS are the most frequently used system objects in every user database. You should ALWAYS use (NOLOCK) when attempting to directly retrieve data from those tables.|||You might also want to use the information_schema views rather than looking up directly in the tables. They're more typing but if this is part of a script/procedure having a lifetime that might span generations of SQL Server, this is safer. The system tables can change; the views will be kept stable.

Saturday, February 25, 2012

Cannot install Database Diagrams on AdventureWorks Database

Error Message: Database diagram support objects cannot be installed because this database does not have a valid owner.

How do I create a valid owner for the database?


http://www.sql-server-performance.com/faq/sqlviewfaq.aspx?faqid=196

Jens K. Suessmeyer.

http://www.sqlserver2005.de
|||

Thank you. The compatibility is set to 2005 (90) already. This might be it though:

"The "no valid owner" issue usually comes up when databases are owned by SQL-authentication logins and are upgraded, detached/attached to another server, or restored from backup to another server. The SID (a large number) doesn't match any existing login on the new server, so the owner name remains whatever it was on the old server, but it is marked invalid. Explicitly setting the owner to a valid principal on the server solves the problem."

How do I explicitly set the owner to a valid principal on the server?

|||

TO THE TOP: The compatibility is set correctly. How do I explicitly set the owner to a valid principal on the server?