When generating the DDL file, if the option "DROP" (include drop commands) is unchecked, the GO statements are missing for each INDEX and CONSTRAINTS creation. If the option is checked, the last GO statement is missing from the file.
解决办法
Use the Script tab in the Object Explorer to get a script for an object.