SQL Job step fails due to database name

  • Afternoon all,

    I'm trying to create a Job step to fail over a sharepoint database which has a GUID.

    I can create and run a db failover command like in a query windows as follows, without issue:

    ALTER DATABASE "SharePoint_AdminContent_7611c14c-139f-453f-900a-25115283c0a1" SET PARTNER FAILOVER

    Using the same command in a Job step fails, which it would seem is due to it ignoring the quotation marks.

    Is there a way I can run the command in a job step where the name containers dashes?

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

  • I've had this issue before, with database names that either contain dashes or start with a number.

    Use the square brackets and that should be okay:

    ALTER DATABASE [Blah-Blah] ...

    ------------------------------------------------------------------------
    Bite-sized fiction (with added teeth) [/url]

  • yeah... of course it should!

    It Appears i've had a bit of a blonde moment! I don't know why I didn't think of that

    Thank you!

    _____________________________________________________________________________MCITP: Business Intelligence Developer (2005)

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

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