Possible Duplicate:
Maximum size for a SQL Server Query? IN clause? Is there a Better Approach

I Researched for some time and should not find whether there's some hard limit how huge query strings could be in SQL Server. I am talking about let's say I develop a 100 million character query - does it run or will the server just drop it as being too lengthy?

It is possible to limit to how lengthy SQL query could be (when it comes to figures or tokens or whatever like this) in SQL Server?

I never experienced an issue of SQL query being too lengthy when it comes to quantity of figures, but there's a most of tables a question can reference (256) and that i hit this limitation a couple of occasions.

Have you ever encountered a query that SQL Server could not execute because it referenced too many tables?