Users filing primary - move to other filespace?

  • Good day,

    I have a few data warehouses that I have two users creating tables for this or that, and these are always tables "I need, and cannot delete yet".  The problem is that these tables are generally created in the primary file space, and when they fill up, the database itself will stop.  I have a new file space for these users to use, and it will be up to them to stay with in these sizes.  The problem is that I cannot seem to get these users to default to this file space.  Is there a way I can do this?

    TIA

    Cory

    -- Cory

  • As per Books on Line. DEFAULT filegroup should be answer of your question. below is the example.
    DEFAULT

    Specifies the filegroup as the default database filegroup. Only one database filegroup can be default. CREATE DATABASE sets the primary filegroup as the initial default filegroup. New tables and indexes are created in the default filegroup—if no filegroup is specified in the CREATE TABLE, ALTER TABLE, or CREATE INDEX statements.

    ======= Example========

    This example creates a filegroup in the Test 1 database created in Example A and adds two 5-MB files to the filegroup. It then makes Test1FG1 the default filegroup.

    USE masterGOALTER DATABASE Test1ADD FILEGROUP Test1FG1GOALTER DATABASE Test1 ADD FILE ( NAME = test1dat3,  FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\t1dat3.ndf',  SIZE = 5MB,  MAXSIZE = 100MB,  FILEGROWTH = 5MB),( NAME = test1dat4,  FILENAME = 'c:\Program Files\Microsoft SQL Server\MSSQL\Data\t1dat4.ndf',  SIZE = 5MB,  MAXSIZE = 100MB,  FILEGROWTH = 5MB)TO FILEGROUP Test1FG1ALTER DATABASE Test1MODIFY FILEGROUP Test1FG1 DEFAULTGO

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

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