In 2012, how to create a fully contained database?

  • based on a previous post here, someone had a quesiton on Contained databases, so i decided to create one myself to follow along.

    BOL says the settings for the database containment can be NONE, PARTIAL or FULL.

    When you create a database via the GUI, you only get a selection for PARTIAL or NONE.

    so how do you create a fully contained database?

    if i use the scripting option, and try to modify the script to say FULL, i get a syntax error.

    Msg 156, Level 15, State 1, Line 2

    Incorrect syntax near the keyword 'FULL'.

    Msg 911, Level 16, State 1, Line 1

    Database 'FullyContained' does not exist. Make sure that the name is entered correctly.

    CREATE DATABASE [FullyContained]

    CONTAINMENT = FULL

    ON PRIMARY

    ( NAME = N'FullyContained', FILENAME = N'F:\SQLData\SQL2012\FullyContained.mdf' , SIZE = 4096KB , FILEGROWTH = 1024KB )

    by the way, my Google-Fu is strong, and everything i see in BOL so far shows changing a database from None to Partial, but nothing for Partial to FULL or None to FULL

    LOG ON

    ( NAME = N'FullyContained_log', FILENAME = N'F:\SQLData\SQL2012\FullyContained_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%)

    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!

  • Lowell (7/11/2013)


    So how do you create a fully contained database?

    You don't. 2012 only allows partially contained.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • This link explains further

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

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

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