How to increase column limit of a table in SQLite?
SQLite: How can we configure the maximum number of columns allowed in a table?
sqlite
add a comment |
SQLite: How can we configure the maximum number of columns allowed in a table?
sqlite
3
If you need more than 2000 columns this almost always indicates a bad database model (i.e. not normalized)
– a_horse_with_no_name
Nov 1 '18 at 11:47
add a comment |
SQLite: How can we configure the maximum number of columns allowed in a table?
sqlite
SQLite: How can we configure the maximum number of columns allowed in a table?
sqlite
sqlite
asked Nov 1 '18 at 7:07
Vishnu CBVishnu CB
61
61
3
If you need more than 2000 columns this almost always indicates a bad database model (i.e. not normalized)
– a_horse_with_no_name
Nov 1 '18 at 11:47
add a comment |
3
If you need more than 2000 columns this almost always indicates a bad database model (i.e. not normalized)
– a_horse_with_no_name
Nov 1 '18 at 11:47
3
3
If you need more than 2000 columns this almost always indicates a bad database model (i.e. not normalized)
– a_horse_with_no_name
Nov 1 '18 at 11:47
If you need more than 2000 columns this almost always indicates a bad database model (i.e. not normalized)
– a_horse_with_no_name
Nov 1 '18 at 11:47
add a comment |
3 Answers
3
active
oldest
votes
You would have to obtain the Source Code for SQLLite, change the value of SQLITE_MAX_COLUMN, recompile the code and distrbute the resulting executable.
However, more than 2000 columns in a single table sounds wrong to me.
Do you have lots of repeated fields in each row? That's poor Relational design.
If necessary, create a second table with the same primary key as the first and add your additional fields into that. You would have to issue two select statements to retrieve the values, though, because SQLITE_MAX_COLUMNS also applies to select statements, so you can't just join the two tables together.
add a comment |
As per SQLite documentation Limits In SQLite
"Limits" in the context of sizes or quantities that can not be exceeded. We are concerned with things like the maximum number of bytes in a BLOB or the maximum number of columns in a table.
[...]
Maximum Number Of Columns
The
SQLITE_MAX_COLUMNcompile-time parameter is used to set an upper bound on:
- The number of columns in a table
- The number of columns in an index
- The number of columns in a view
- The number of terms in the SET clause of an UPDATE statement
- The number of columns in the result set of a SELECT statement
- The number of terms in a GROUP BY or ORDER BY clause
- The number of values in an INSERT statement
The default setting for
SQLITE_MAX_COLUMNis2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than 100 columns in a table.
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
add a comment |
As specified in Limits In SQLite:
The default setting for SQLITE_MAX_COLUMN is
2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than100columns in a table.
You will have to compile SQLite with the corresponding compile-time option SQLITE_MAX_COLUMN as described in How To Compile SQLite
I downloaded and unpacked the snapshot version from the Download page,
- First ran
./configureand - Waited till the
Makefilehad been created - Opened the
Makefileand added-DSQLITE_MAX_COLUMN=32767to the end of the line startingDEFS =and saved the file. - Finally, ran
maketo compile the binary (this is for Linux/macOS/*nix, though)
For an edge case I also had to increase the following options (none of this is recommended)
-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_SQL_LENGTH=1073741824 -DSQLITE_MAX_LENGTH=1273741824 -DSQLITE_MAX_FUNCTION_ARG=127 -DSQLITE_MAX_VARIABLE_NUMBER=65534
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "182"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f221508%2fhow-to-increase-column-limit-of-a-table-in-sqlite%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
You would have to obtain the Source Code for SQLLite, change the value of SQLITE_MAX_COLUMN, recompile the code and distrbute the resulting executable.
However, more than 2000 columns in a single table sounds wrong to me.
Do you have lots of repeated fields in each row? That's poor Relational design.
If necessary, create a second table with the same primary key as the first and add your additional fields into that. You would have to issue two select statements to retrieve the values, though, because SQLITE_MAX_COLUMNS also applies to select statements, so you can't just join the two tables together.
add a comment |
You would have to obtain the Source Code for SQLLite, change the value of SQLITE_MAX_COLUMN, recompile the code and distrbute the resulting executable.
However, more than 2000 columns in a single table sounds wrong to me.
Do you have lots of repeated fields in each row? That's poor Relational design.
If necessary, create a second table with the same primary key as the first and add your additional fields into that. You would have to issue two select statements to retrieve the values, though, because SQLITE_MAX_COLUMNS also applies to select statements, so you can't just join the two tables together.
add a comment |
You would have to obtain the Source Code for SQLLite, change the value of SQLITE_MAX_COLUMN, recompile the code and distrbute the resulting executable.
However, more than 2000 columns in a single table sounds wrong to me.
Do you have lots of repeated fields in each row? That's poor Relational design.
If necessary, create a second table with the same primary key as the first and add your additional fields into that. You would have to issue two select statements to retrieve the values, though, because SQLITE_MAX_COLUMNS also applies to select statements, so you can't just join the two tables together.
You would have to obtain the Source Code for SQLLite, change the value of SQLITE_MAX_COLUMN, recompile the code and distrbute the resulting executable.
However, more than 2000 columns in a single table sounds wrong to me.
Do you have lots of repeated fields in each row? That's poor Relational design.
If necessary, create a second table with the same primary key as the first and add your additional fields into that. You would have to issue two select statements to retrieve the values, though, because SQLITE_MAX_COLUMNS also applies to select statements, so you can't just join the two tables together.
answered Nov 1 '18 at 11:29
Phill W.Phill W.
61131
61131
add a comment |
add a comment |
As per SQLite documentation Limits In SQLite
"Limits" in the context of sizes or quantities that can not be exceeded. We are concerned with things like the maximum number of bytes in a BLOB or the maximum number of columns in a table.
[...]
Maximum Number Of Columns
The
SQLITE_MAX_COLUMNcompile-time parameter is used to set an upper bound on:
- The number of columns in a table
- The number of columns in an index
- The number of columns in a view
- The number of terms in the SET clause of an UPDATE statement
- The number of columns in the result set of a SELECT statement
- The number of terms in a GROUP BY or ORDER BY clause
- The number of values in an INSERT statement
The default setting for
SQLITE_MAX_COLUMNis2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than 100 columns in a table.
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
add a comment |
As per SQLite documentation Limits In SQLite
"Limits" in the context of sizes or quantities that can not be exceeded. We are concerned with things like the maximum number of bytes in a BLOB or the maximum number of columns in a table.
[...]
Maximum Number Of Columns
The
SQLITE_MAX_COLUMNcompile-time parameter is used to set an upper bound on:
- The number of columns in a table
- The number of columns in an index
- The number of columns in a view
- The number of terms in the SET clause of an UPDATE statement
- The number of columns in the result set of a SELECT statement
- The number of terms in a GROUP BY or ORDER BY clause
- The number of values in an INSERT statement
The default setting for
SQLITE_MAX_COLUMNis2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than 100 columns in a table.
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
add a comment |
As per SQLite documentation Limits In SQLite
"Limits" in the context of sizes or quantities that can not be exceeded. We are concerned with things like the maximum number of bytes in a BLOB or the maximum number of columns in a table.
[...]
Maximum Number Of Columns
The
SQLITE_MAX_COLUMNcompile-time parameter is used to set an upper bound on:
- The number of columns in a table
- The number of columns in an index
- The number of columns in a view
- The number of terms in the SET clause of an UPDATE statement
- The number of columns in the result set of a SELECT statement
- The number of terms in a GROUP BY or ORDER BY clause
- The number of values in an INSERT statement
The default setting for
SQLITE_MAX_COLUMNis2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than 100 columns in a table.
As per SQLite documentation Limits In SQLite
"Limits" in the context of sizes or quantities that can not be exceeded. We are concerned with things like the maximum number of bytes in a BLOB or the maximum number of columns in a table.
[...]
Maximum Number Of Columns
The
SQLITE_MAX_COLUMNcompile-time parameter is used to set an upper bound on:
- The number of columns in a table
- The number of columns in an index
- The number of columns in a view
- The number of terms in the SET clause of an UPDATE statement
- The number of columns in the result set of a SELECT statement
- The number of terms in a GROUP BY or ORDER BY clause
- The number of values in an INSERT statement
The default setting for
SQLITE_MAX_COLUMNis2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than 100 columns in a table.
edited Nov 1 '18 at 11:57
hot2use
8,12952055
8,12952055
answered Nov 1 '18 at 7:30
Md Haidar Ali KhanMd Haidar Ali Khan
3,56762340
3,56762340
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
add a comment |
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
What is the procedure to change the default value of SQLITE_MAX_COLUMN?
– Vishnu CB
Nov 1 '18 at 9:26
add a comment |
As specified in Limits In SQLite:
The default setting for SQLITE_MAX_COLUMN is
2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than100columns in a table.
You will have to compile SQLite with the corresponding compile-time option SQLITE_MAX_COLUMN as described in How To Compile SQLite
I downloaded and unpacked the snapshot version from the Download page,
- First ran
./configureand - Waited till the
Makefilehad been created - Opened the
Makefileand added-DSQLITE_MAX_COLUMN=32767to the end of the line startingDEFS =and saved the file. - Finally, ran
maketo compile the binary (this is for Linux/macOS/*nix, though)
For an edge case I also had to increase the following options (none of this is recommended)
-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_SQL_LENGTH=1073741824 -DSQLITE_MAX_LENGTH=1273741824 -DSQLITE_MAX_FUNCTION_ARG=127 -DSQLITE_MAX_VARIABLE_NUMBER=65534
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
As specified in Limits In SQLite:
The default setting for SQLITE_MAX_COLUMN is
2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than100columns in a table.
You will have to compile SQLite with the corresponding compile-time option SQLITE_MAX_COLUMN as described in How To Compile SQLite
I downloaded and unpacked the snapshot version from the Download page,
- First ran
./configureand - Waited till the
Makefilehad been created - Opened the
Makefileand added-DSQLITE_MAX_COLUMN=32767to the end of the line startingDEFS =and saved the file. - Finally, ran
maketo compile the binary (this is for Linux/macOS/*nix, though)
For an edge case I also had to increase the following options (none of this is recommended)
-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_SQL_LENGTH=1073741824 -DSQLITE_MAX_LENGTH=1273741824 -DSQLITE_MAX_FUNCTION_ARG=127 -DSQLITE_MAX_VARIABLE_NUMBER=65534
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
As specified in Limits In SQLite:
The default setting for SQLITE_MAX_COLUMN is
2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than100columns in a table.
You will have to compile SQLite with the corresponding compile-time option SQLITE_MAX_COLUMN as described in How To Compile SQLite
I downloaded and unpacked the snapshot version from the Download page,
- First ran
./configureand - Waited till the
Makefilehad been created - Opened the
Makefileand added-DSQLITE_MAX_COLUMN=32767to the end of the line startingDEFS =and saved the file. - Finally, ran
maketo compile the binary (this is for Linux/macOS/*nix, though)
For an edge case I also had to increase the following options (none of this is recommended)
-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_SQL_LENGTH=1073741824 -DSQLITE_MAX_LENGTH=1273741824 -DSQLITE_MAX_FUNCTION_ARG=127 -DSQLITE_MAX_VARIABLE_NUMBER=65534
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
As specified in Limits In SQLite:
The default setting for SQLITE_MAX_COLUMN is
2000. You can change it at compile time to values as large as32767. On the other hand, many experienced database designers will argue that a well-normalized database will never need more than100columns in a table.
You will have to compile SQLite with the corresponding compile-time option SQLITE_MAX_COLUMN as described in How To Compile SQLite
I downloaded and unpacked the snapshot version from the Download page,
- First ran
./configureand - Waited till the
Makefilehad been created - Opened the
Makefileand added-DSQLITE_MAX_COLUMN=32767to the end of the line startingDEFS =and saved the file. - Finally, ran
maketo compile the binary (this is for Linux/macOS/*nix, though)
For an edge case I also had to increase the following options (none of this is recommended)
-DSQLITE_MAX_COLUMN=32767 -DSQLITE_MAX_SQL_LENGTH=1073741824 -DSQLITE_MAX_LENGTH=1273741824 -DSQLITE_MAX_FUNCTION_ARG=127 -DSQLITE_MAX_VARIABLE_NUMBER=65534
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 21 mins ago
iolsmitiolsmit
1011
1011
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
iolsmit is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Thanks for contributing an answer to Database Administrators Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdba.stackexchange.com%2fquestions%2f221508%2fhow-to-increase-column-limit-of-a-table-in-sqlite%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
3
If you need more than 2000 columns this almost always indicates a bad database model (i.e. not normalized)
– a_horse_with_no_name
Nov 1 '18 at 11:47