RE: How you calculate large database size in number of bytes ?

I want to create a large database in the year 2017, but I don’t want to calculate a number of bytes. What are the options for the scale of numeric values in the MAXSIZE parameter? Meaning, as an example, can I use 10KB as a value instead of choosing 10240?

sid Asked on September 12, 2017 in SQL Serve.
Add Comment
1 Answers

Answer: The KB, MB, GB, and TB abbreviations can be used.

Explanation:

As of now (2017), only the KB, MB, GB, and TB abbreviations can be used.

Create a database
CREATE DATABASE database_name
[ CONTAINMENT = { NONE | PARTIAL } ]
[ ON
[ PRIMARY ] <filespec> [ ,…n ]
[ , <filegroup> [ ,…n ] ]
[ LOG ON <filespec> [ ,…n ] ]
]
[ COLLATE collation_name ]
[ WITH  <option> [,…n ] ]
[;]
<option> ::=
{
FILESTREAM ( <filestream_option> [,…n ] )
| DEFAULT_FULLTEXT_LANGUAGE = { lcid | language_name | language_alias }
| DEFAULT_LANGUAGE = { lcid | language_name | language_alias }
| NESTED_TRIGGERS = { OFF | ON }
| TRANSFORM_NOISE_WORDS = { OFF | ON}
| TWO_DIGIT_YEAR_CUTOFF = <two_digit_year_cutoff>
| DB_CHAINING { OFF | ON }
| TRUSTWORTHY { OFF | ON }
}

<filestream_option> ::=
{
NON_TRANSACTED_ACCESS = { OFF | READ_ONLY | FULL }
| DIRECTORY_NAME = ‘directory_name’
}

<filespec> ::=   
{  
(  
    NAME = logical_file_name ,  
    FILENAME = { ‘os_file_name’ | ‘filestream_path’ }   
    [ , SIZE = size [ KB | MB | GB | TB ] ]   
    [ , MAXSIZE = { max_size [ KB | MB | GB | TB ] | UNLIMITED } ]   
    [ , FILEGROWTH = growth_increment [ KB | MB | GB | TB | % ] ]  
)  
}  

<filegroup> ::=
{
FILEGROUP filegroup name [ [ CONTAINS FILESTREAM ] [ DEFAULT ] | CONTAINS MEMORY_OPTIMIZED_DATA ]
<filespec> [ ,…n ]
}

<service_broker_option> ::=
{
ENABLE_BROKER
| NEW_BROKER
| ERROR_BROKER_CONVERSATIONS
}

In above syntax  In file space section we can provide SIZE  (KB | MB | GB | TB ]) for backup file.

The value can be specified in MB, KB, GB, TB, or percent (%). If a number is specified without an MB, KB, or % suffix, the default is MB. When % is specified, the growth increment size is the specified percentage of the size of the file at the time the increment occurs. The size specified is rounded to the nearest 64 KB, and the minimum value is 64 KB.

 

Answered on September 13, 2017.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.