Results 1 to 10 of 10

Thread: Detach Error

  1. #1
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789

    Unanswered: Detach Error

    Good morning everyone, well I moved the LDF to a different folder on a different disk, detached the database then we attaching it told it where the new location is for the LDF and it gave me an error message saying that the proposed new owner is already and aliased or user in the database. Can anyone tell me what I am doing wrong cause I full access to SQL SERVER, I'm an Admin

  2. #2
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Good morning everyone, well I DETATCHED THE Database then moved the LDF to a different folder on a different disk, detached the database then we attaching it told it where the new location is for the LDF and it gave me an error message saying that "the proposed new owner is already and aliased or user in the database". Can anyone tell me what I am doing wrong cause I full access to SQL SERVER, I'm an Admin

    full error message

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Attach database failed for Server 'GCSQL'. (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdN...r&LinkId=20476

    ------------------------------
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    The proposed new database owner is already a user or aliased in the database. (Microsoft SQL Server, Error: 15110)

    For help, click: http://go.microsoft.com/fwlink?ProdN...0&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

  3. #3
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    When you move files to another folder and especially when you split the LDF and MDF up (so they are no longer in the same folder as each other), using the GUI to attach the files gets persnickity. All of the files must be on local drives, you can't easily use a UNC or a share.

    Explicitly attach the files using fully qualified drive letters and pathnames by executing sp_attach_db. If it burps, post the error message(s) and I'll try to figure out what went bump in the night.

    -PatP

  4. #4
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    Hi there Pat

    the strange thing is, Databases did attach and when i go to the properties and then Files I see the LDF is in the new location I put it in?

  5. #5
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    Most likely, the error message is correct. When you attach a database to SQL 2000, the person running the command becomes the owner of the database. If you already have a user mapped to your login in the database this final step would fail. I would expect the database has been successfully attached, and is currently listed as being owned by the previous owner. You can try to run the attach with the sa account, rather than your Windows account to prove this out.

  6. #6
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    just making sure I understand you. So your saying that I should impersonate the SA account then try to detach??

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I doubt very much if MCrowley was suggesting that you do anything at all. I'm sure that he'll chime in and confirm or deny that when he gets a chance.

    What I think he was trying to tell you was that you could log in as sa and execute sp_attach_db to see if you could attach without getting an error.

    I highly doubt that this is important enough for you to take the time to do it, even though it only takes a few seconds if you script the detach and subsequent attach.

    -PatP

  8. #8
    Join Date
    Feb 2004
    Location
    Alpine Califormia
    Posts
    1,789
    oh ok I used the wrong terminology he meant Log in as SA I see, I just need to know what password is.
    Last edited by desireemm; 01-09-09 at 18:38.

  9. #9
    Join Date
    Jan 2003
    Location
    Massachusetts
    Posts
    5,800
    Provided Answers: 11
    I suggested an academic exercise. Whether that constitutes actually encouraging someone to do something is a matter for the lawyers to debate.
    To reiterate, I suspect the database has been successfully attached, despite the error message. If that seems to be the case to you as well, then you needn't do anything more. of course, if you have a test box just lying around, and want to play around to learn new stuff.....

  10. #10
    Join Date
    Aug 2008
    Location
    India
    Posts
    55
    One important thing which has to be kept in mind is that permissions while moving dbs from one disk to another which may get lost . especially dbo and default db settings etc

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •