Hi @Ailsa Ge ,
This question has nothing to do with which database you use. In theory, if one statement return an error, the next statement will stop executing. But there are some exceptions.
In my opinion, it may be understood like this:
The first step when executing a statement is to find the table to be operated on. When you use the main database, since there is no table [20180521] in the main database, this error is returned first. And this error does not allow the next statement to continue execution, so other statements did not execute successfully.
When you use the under_group database, the [20180521] table is in the under_group database, so the same error as the main database will not be returned. Next, because the IDENTITY_INSERT property is set to off, data cannot be inserted explicitly. But this error allows the next statement to continue. So other statements are executed successfully.
If you have any question, please feel free to let me know.
If the response is helpful, please click "Accept Answer" and upvote it.
Regards
Echo
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.