I have afile qith sql query with 48776 charactersI believe the limit for Command Text is 32,767 chars.
It's kind of package with lots of temporary tables and variables.. view willnot allow me to do so.As @Chihiro has pointed out you are over the string limit, way over, your sql query with 48776 characters does seem long, can you not use defined functions?
I can create procedures. If i call procedure from excel, will it always be executed whenever i open the file?Can you not split the SQL so that the procedures runs from one to the other