This error is likely due to the size of your SQL Query file.
It may be simplest to find an alternative way to transfer your data, such as using the "Import Data" Wizard. (Right-click on your destination database and select Tasks -> "Import Data.")
Or, if you need to run this Query File, you could try using "sqlcmd" as discussed in this post and this related answer.