Error 21776

  • A client provided a .bak file exported from their SQL server to be installed onto ours. Being rather new at ms-sql server, I'm thinking I screwed up something.

    I went to restore database, selected the .bak file, edited the target location (it showed what was included in the .bak file - 2 files - on .mdf and one transaction log file - I just changed the target location from the f:\ which is what was in there to where we wanted the db). Ok, that seemed to go fine..

    Now in my Databases list I have an icon for Users (db gold with blue head) with the normal stuff inside (diagrams, tables etc.). There is no name with this icon. When I right click to delete, I get:

    Error 21776:[SQL-DMO]The name 'ruth' was not found in the Databases Collection. If the name is a qualified name, use [] to separate various parts of the name and try again.

    'ruth' is what the mdf and transaction log were called when it looked at the .bak file.

    1 - How do I rectify my screwup here and 2 - how do I best handle this person sending an SQL 2000 db as a .bak file to install it onto our server and setup a system dsn for it so they can access it?

    Thanks!

    Steve

  • Ok, I got that db deleted. I created a new db called 'ruth' and all of a sudden I was allowed to delete that other db with no name.

    Now my question is this .bak file they sent. How do I get this into our system and setup as a db? I looked at it in a text editor and there are a few visible strings in the file:

    TAPE

    M i c r o s o f t S Q L S e r v e r SPAD

    r u t h b a c k u p M A S T E R \ b f r e e m a n

    r u t h _ D a t a f : \ s q l \ M S S Q L \ d a t a \ r u t h _ D a t a . M D F

    r u t h _ L o g f : \ s q l \ M S S Q L \ d a t a \ r u t h _ L o g . L D F SPAD

    If someone can help with this, that'd be great. I'd also like to know what's a good book to get started on SQL administration - I've seen tons on programming, but need to know more about the server side of it.

    thanks again!

  • Believe it or not, Microsoft's online documentation (BOL) is suprisingly good.

    I'm not sure what happed with your first restore attempt. It seems like you basically did the right thing. In any case, the syntax for a restore is as follows:

    RESTORE DATABASE Ruth

    FROM DISK = 'c:\Ruth.bak'

    WITH MOVE 'Ruth_Data' TO 'f:\Ruth.mdf',

    MOVE 'Ruth_log' TO 'f:\Ruth.ldf'

    You want to create a new database called Ruth before you attempt to restore from the .BAK.

    After you restore the database, you'll have to sync the users to your server's logins. Check BOL for sp_change_users_login.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply