Showing posts with label attached. Show all posts
Showing posts with label attached. Show all posts

Thursday, March 22, 2012

AdventureWorks Owner

Hi,

I've installed AdventureWorks, attached it to SQL Express and wanted to see its Database Diagrams. When I click on the Database Diagrams, I get this error message:

TITLE: Microsoft SQL Server Management Studio Express

Database diagram support objects cannot be installed because this database does not have a valid owner. To continue, first use the Files page of the Database Properties dialog box or the ALTER AUTHORIZATION statement to set the database owner to a valid login, then add the database diagram support objects.

--

I really see that in properties for this database there's no owner, while if I do

sp_helpdb 'AdventureWorks'

It shows that the owner is 'IDB-SERV\Michael' , which is my user.

I further tried to set this user as an owner in AdventureWorks properties-files window (where it showed no owner), but it says :

TITLE: Microsoft SQL Server Management Studio Express

Set owner failed for Database 'AdventureWorks'. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Set+owner+Database&LinkId=20476


ADDITIONAL INFORMATION:

An exception occurred in SMO. (Microsoft.SqlServer.Express.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.2047.00&LinkId=20476

The login 'IDB-SERV\Michael' does not exist on this server.

Are all these bugs, or did I miss something?

Please, help

Thanx a lot !!!!

Moisha, here are a few threads hitting the same error.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=112297&SiteID=1

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=228352&SiteID=1

They both seem to be solving the problem using sp_dbcmptlevel.

Take a look at the threads and see if it applies to your environment.

Thanks,
Sam Lester (MSFT)
|||

Moisha,

The quick solution for me - which I distilled from the links posted here - was to execute the sp_dbcmptlevel procedure. I did not need to do anything else.

EXEC sp_dbcmptlevel 'nameOfDatabase', '90';

Sunshine is my life. Clean air is my right.

AdventureWorks DB sample

OK, I've installed SQL 2k5, and I'm sure I selected Advanced>Samples

however I cannot see the AdventureWorks database attached.

I have tried opening SQL Server manager>right click on databases>Attach>Add but this only brings up a Folder explorer, not a file explorer.

I can navigate to where the AdventureWorks samples are but SQL Server manager is not able to attach them because it is a Folder explore. also, I have the samples in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data but I am only able to browse to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\

How then can I attach the database?

(later on...) Ok I still cant browse to the Data directory, but I copied the contents of this directory into its parent directory which I can browse to. I still could not see the files in the directory because it is a tree view with no way to see files, so I typed in the name of the AdventureWorks database that I wanted to attach.

Then I got a permissions error - I wasnt able to attach the DB even though I had connected using windows permissions.

This is really starting to frustrate me - I have wasted many hours on something that should be straight forward.

You should find the sample Db under the following directory.

C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks OLTP

|||

See the book online section:

SQL Server Setup Help Running Setup to Install AdventureWorks Sample Databases and Samples

It contains detailed steps to get the AdventureWorks DB samples installed.

|||

The sample db is in 90\Tools location ok but I seem not to get the step 9. in the Setup post installation procedure which says

"To install and attach the sample databases, from Sample Databases Setup, select Install and attach sample databases, and then click Next.

The database files are created and stored in the folder <drive>:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data. The database is attached and ready for use."

(there's just a cert in MSSQL.1\MSSQL\Data)

AdventureWorks DB sample

OK, I've installed SQL 2k5, and I'm sure I selected Advanced>Samples

however I cannot see the AdventureWorks database attached.

I have tried opening SQL Server manager>right click on databases>Attach>Add but this only brings up a Folder explorer, not a file explorer.

I can navigate to where the AdventureWorks samples are but SQL Server manager is not able to attach them because it is a Folder explore. also, I have the samples in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data but I am only able to browse to C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\

How then can I attach the database?

(later on...) Ok I still cant browse to the Data directory, but I copied the contents of this directory into its parent directory which I can browse to. I still could not see the files in the directory because it is a tree view with no way to see files, so I typed in the name of the AdventureWorks database that I wanted to attach.

Then I got a permissions error - I wasnt able to attach the DB even though I had connected using windows permissions.

This is really starting to frustrate me - I have wasted many hours on something that should be straight forward.

You should find the sample Db under the following directory.

C:\Program Files\Microsoft SQL Server\90\Tools\Samples\AdventureWorks OLTP

|||

See the book online section:

SQL Server Setup Help Running Setup to Install AdventureWorks Sample Databases and Samples

It contains detailed steps to get the AdventureWorks DB samples installed.

|||

The sample db is in 90\Tools location ok but I seem not to get the step 9. in the Setup post installation procedure which says

"To install and attach the sample databases, from Sample Databases Setup, select Install and attach sample databases, and then click Next.

The database files are created and stored in the folder <drive>:\Program Files\Microsoft SQL Server\MSSQL.n\MSSQL\Data. The database is attached and ready for use."

(there's just a cert in MSSQL.1\MSSQL\Data)