Filegroup already in existence

  • hello, I'm nee here and new to SQL DBA, so forgive how pedestrian I am about to sound. I am learning to create filegroups using GUI and TSQL, I sucessfully created multiple file groups using GUI however when it came to creating it using TSQL i am getting an error which I am posting below

    Msg 5035, Level 16, State 1, Line 2

    Filegroup 'SBSTSQLGroup1' already exists in this database. Specify a different name or remove the conflicting filegroup if it is empty.

    Please what do I do?

  • Thanks for posting your issue and hopefully someone will answer soon.

    This is an automated bump to increase visibility of your question.

  •  

    DIREKATUNG wrote:

    hello, I'm nee here and new to SQL DBA, so forgive how pedestrian I am about to sound. I am learning to create filegroups using GUI and TSQL, I sucessfully created multiple file groups using GUI however when it came to creating it using TSQL i am getting an error which I am posting below

    Msg 5035, Level 16, State 1, Line 2 Filegroup 'SBSTSQLGroup1' already exists in this database. Specify a different name or remove the conflicting filegroup if it is empty.

    Please what do I do?

    Heh... you're concerned about airs of a pedestrian and I'm concerned about being accused of sounding like Captain Obvious. 😀

    Run the following in the database where you're trying to add that file group...

     SELECT * FROM sys.FileGroups
    WHERE name = 'SBSTSQLGroup1'
    ;

    If it comes back with a row, then the filegroup already exists (and, from what the error message said, it will).  The question is, what do you want to do if it does?

    If you're just practicing and you made the filegroup from the GUI, it's still going to exist.  If there's nothing that you need from it, just drop it (it won't let you if it contains a file) and then you can practice making it with code.

     

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • This was removed by the editor as SPAM

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

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