1

I am new to SQL. I want to feed data from SQL to my program. Right now an SQL request is generated by concatenating multiple statements. Is there a limit on the number of nested functions in excel (similar to the seven nested functions per formula limit in Excel)? Or will it try to execute arbitrary complex statement?


"It depends basically on the DBMS you're using. All of them have some sort of max SQL statement length limit." - Can you please share the information about these limits? I am interested in SQL server, but limits of other DBMS might be of interest to other SO visitors.

Steve
  • 45
  • 4
  • It depends basically on the DBMS you're using. All of them have some sort of max SQL statement length limit. – Leo May 30 '16 at 17:07
  • 2
    The fact that you are asking this question indicates that your overall approach might have room for improvement. – Dan Bracuk May 30 '16 at 17:12
  • I am using SQL server 2012 and I expect up to 15 keywords in the statement. I am not hitting a limit yet, but I want to avoid a nasty surprise. – Steve May 30 '16 at 18:36
  • What exactly do you mean with "up to 15 _keywords_"? Even without a join it's probably possible to use 15 keywords in a single query. Or are you actually talking about "15 _tables_"? –  May 30 '16 at 18:42
  • 1
    I am talking about keywords like "select", "from", "where", etc. – Steve May 30 '16 at 22:07
  • Can you please explain the reason of downvoting? I am new to Stackoverflow and it would help to know what I did wrong. Is the question off-topic? Or tagged incorrectly? Or offensive? – Steve May 30 '16 at 22:09
  • Maybe it's the not showing any research -part or being unclear. Nested function and a keyword are totally different things, so it's quite hard to understand what you're actually asking. – James Z May 31 '16 at 03:09
  • 1
    http://stackoverflow.com/questions/8881291/why-is-char-preferred-over-string-for-passwords-in-java/8881376 - this is RTFM, indeed. 2K upvotes. I did research the question and I didn't find anything about the SQL limits. I could research longer, but then what is the point of SO? – Steve May 31 '16 at 14:11

1 Answers1

0

This can be configured using MAX_SQL_LENGTH. On SQLLite you would use SQLLITE_MAX_SQL_REQUEST.

sqlite.org/limits.html has a great article on other limits. Also check
http://www.codeproject.com/Articles/126380/Writing-Readable-SQL for a style reference.

tryJava
  • 84
  • 3