Title: What size for a SqlDbType parameter with bigint?
Tags: c#;sql-server;size;sqlparameter;sqldbtype
Question: What is the size to specify for a bigint parameter?

```SqlParameter param = new SqlParameter("@Param", SqlDbType.Bigint);

param.Size = ???
```

Or can specifying the size be omitted altogether?

Comment: sql server BIGINT data type is 8 byte data type and you do not specify any size with it.

Comment: Thanks. Could you provide an answer with a supporting link for that information? I'll select that answer

Here is the accepted answer: SQL Server Integer Data types INT, TINYINT, SMALLINT OR BIGINT all has a specific Range and fixed storage space required. 

In Sql Server when consuming these data types we cannot limit the range or space required to store these data types by defining a size. 

For more information on size and range of these data types have a look here ```SQL SERVER int, bigint, smallint, and tinyint``` 

```╔═══════════╦══════════════════════════════════════════════════════════════════════════╦═════════╗
║ Data type ║                                  Range                                   ║ Storage ║
╠═══════════╬══════════════════════════════════════════════════════════════════════════╬═════════╣
║ bigint    ║ -2^63 (-9,223,372,036,854,775,808) to 2^63-1 (9,223,372,036,854,775,807) ║ 8 Bytes ║
║ int       ║ -2^31 (-2,147,483,648) to 2^31-1 (2,147,483,647)                         ║ 4 Bytes ║
║ smallint  ║ -2^15 (-32,768) to 2^15-1 (32,767)                                       ║ 2 Bytes ║
║ tinyint   ║ 0 to 255                                                                 ║ 1 Byte  ║
╚═══════════╩══════════════════════════════════════════════════════════════════════════╩═════════╝
```


Here is another answer: Correct you don't need to specify the size when creating the integer type parameters for the command

```Command.Parameters.Add("@p0", SqlDbType.TinyInt)  // omit size, name.
```


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 2, 'CommentCount': 2, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2014:00:09/18/14', 'FavoriteCount': None, 'PostTypeId': 1, 'Tags': '<c#><sql-server><size><sqlparameter><sqldbtype>', 'Title': 'What size for a SqlDbType parameter with bigint?', 'ViewCount': 7901, 'id': 25923804, 'user_AboutMe': '<ul>\n<li>The Lord Jesus Christ saved me in 2005</li>\n<li>Served in the U.S. Marines (2006-2010)</li>\n<li>B.S. in Computer Science</li>\n</ul>\n<blockquote>\n<p>&quot;Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.&quot; — Brian Kernighan</p>\n</blockquote>\n', 'user_AccountId': 1565838.0, 'user_DisplayName': 'reformed', 'user_Reputation': 4245.0, 'user_Views': 1012.0, 'user_id': 1454671.0}}