create table error

  • Msg 1921, Level 16, State 1, Line 3

    Invalid filegroup 'TERTIARY' specified.

    whats wrong plz could any help !. what the issue is

  • Can you post the SQL you're using to create the table

  • SET ANSI_NULLS ON

    GO

    SET QUOTED_IDENTIFIER ON

    GO

    IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[WBN_DueDate_Calling_details]') AND type in (N'U'))

    BEGIN

    CREATE TABLE [dbo].[WBN_DueDate_Calling_details](

    [MON] [varchar](50) NULL,

    [JobID] [varchar](50) NULL,

    [Customer_Name] [varchar](100) NULL,

    [CKT_WORK_LOC_ADD] [varchar](1000) NULL,

    [WIRE_CENTER] [varchar](20) NULL,

    [COMMIT_DATE_TIME] [datetime] NULL,

    [JOB_STATUS] [varchar](50) NULL,

    [Handle_Code] [varchar](25) NULL,

    [FTTP_Type] [varchar](25) NULL,

    [varchar](100) NULL,

    [JOB_START_DATETIME] [datetime] NULL,

    [LAST_UPD_DATETIME] [datetime] NULL,

    [COMMENTS] [varchar](1000) NULL,

    [CUSTOMER_STATUS_DATETIME] [datetime] NULL,

    [REGION] [varchar](25) NULL,

    [Inserted_date] [datetime] NULL

    ) ON [TERTIARY]

    END

    GO

  • the error pretty much tells you what the issue is.

    when you do a CREATE TABLE statment, you can optionally say what filegroup it will be created on...the "default" group is called PRIMARY.

    it looks like you scripted the table definition, and are recreating it on another server, right?

    on the production database, there was a filegroup called TERTIARY (implying there is another filegroup "SECONDARY"?)

    on the server you are running the script on, there is not TERTIARY filegroup, so the statement fails. no big deal.

    anyway, all you have to do is completely remove this part from the statement:

    ON [TERTIARY]

    or replace it with ON [PRIMARY]

    Lowell


    --help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

  • Got it . Thanks for your Help , It helped .

  • If you do a

    select * from sys.filegroups

    can you see the [TERTIARY] filegroup?

    *OK ignore, I wasn't quick enough. Lowell has given you the solution. 🙂

Viewing 6 posts - 1 through 5 (of 5 total)

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