Database exists but name is not legal ?

  • Hello,

    Our Team Lead just installed SharePoint using the wizard which did the database creation. The installation seemed to go fine, but one of the databases has a name which seems impossible. Specifically:

    SharePoint_AdminContent_9e041404-d178-47db-82c6-99adc1c09c38

    This name actually appears in the Query Analyzer drop-down list, and I see the same name when I query "Select * from sysdatabases". However, when I try T-SQL commands to backup the database to disk='xxx', I receive a syntax error near "-", which doesn't surprise me.

    When I try the "Use xxxxx" command, QA says that no database of that name exists in sysdatabases.

    I'm baffled. The name seems to violate syntax rules, but there it is.

    I am able to query tables within the database and use SSMS to make a backup; I just can't use the name of the object when writing commands.

    Details: EE version of SQL 2005. We installed SharePoint using the specified Collation, rather than our Server standard.

    Thanks for any suggestions.

    Elliott

  • does it work when you put square brackets around the name? The database name looks ok i think, the legnth is ok (i think the max is 128 chars) and its not a reserved name or have illegal chars. It will be messy to work with though!

  • Yes, the command worked when I put the square brackets around the database name. I had thought that the dashes, "-" were illegal characters in the name of the database.

    In fact, I can create database "My_DB", but not "My-DB".

    Thanks for the tip. I often use the brackets to allow spaces in column names, etc, but had no idea they would be needed for this.

    As to the awkwardness, yeah that looks really stupid. Because we haven't started to use SharePoint yet, I'm thinking of altering the name of the database and seeing if anything breaks.

    Elliott

  • FYI - I just tried creating a db called my-db and it worked ok. Not sure why it fails for you.

  • More FYI,

    I confirmed that I can create a database with a hyphen in the name if I use the square brackets, but not otherwise.

    Meanwhile, I used the alter database command to change the ugly name of the database and the logical file names to something a little simpler. Now we'll see if SharePoint can follow the change.

    Elliott

  • I had a similar issue with our SharePoint setup. Only I managed to catch it before it went into production. Took one look at the GUID in the name and said "No. There must be a better way to do this".

    Fortunately there was. It's more involved setup & configuration than the SharePoint wizard (natch), but it means you can fully control the database names and make them more sensible.

    The instructions are available from Microsoft, but they are kind of long winded and not entirely intuitive. If anyone is interested, I can provide something a little easier to follow (took the SharePoint dev & I about 2 days to refine).



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


  • Scott,

    I totally agree that retaining control of the database creation and naming is a better way to go. I had downloaded from TechNet two articles: "Deploy using DBA-created databases" and "Plan for administrative and service accounts".

    These are very poor documents.

    Specific examples: There is not an overview to assist the reader to understand that the advice on establishing accounts covers at least four different approaches to doing it. And the internal nomenclature itself is somewhat duplicative (e.g. the "Server Farm Account" is also known as the "Database Access account")

    My lead tried following these instructions(?) once, and when that didn't work, he switched to the Wizard. Can't blame him.

    Anyway, I have changed the name of the database and it looks like SharePoint still recognizes it, so we may be past this particular hurdle.

  • Yep, that was one of our biggest hurdles - sorting out the account references, because they weren't consistent between the documents.

    MS obviously need to do more blind testing - hand the docs to someone who has never done it before & see if they can get it to work.



    Scott Duncan

    MARCUS. Why dost thou laugh? It fits not with this hour.
    TITUS. Why, I have not another tear to shed;
    --Titus Andronicus, William Shakespeare


Viewing 8 posts - 1 through 7 (of 7 total)

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