Is there a limit to how long a SQL query can be in SQL Server? [duplicate]
I never encountered a problem of SQL query being too long in terms of number of characters, but there is a maximum number of tables a query can reference (256) and I hit this limitation a few times.
UPDATE
In recent versions of SQL Server, the number of tables per SELECT
statement is limited only by available resources.