>I have generated a script from SQL Server 2014 to be compatible for SQL Server 2008 R2. So, I selected the option to target at SQL Server 2008 R2. I still see errors such as:
>
>Msg 102, Level 15, State 6, Line 1
>Incorrect syntax near 'CONTAINMENT'.
>Msg 102, Level 15, State 6, Line 1
>Incorrect syntax near 'FILESTREAM'.
>Msg 102, Level 15, State 6, Line 1
>Incorrect syntax near 'TARGET_RECOVERY_TIME'.
>Msg 102, Level 15, State 1, Line 1
>Incorrect syntax near 'DISABLED'.
>
>Anyone could explain that?
I guess you weren't exactly using SQL server to generate the script, you were pulling metadata from it and using SSMS to generate it. I've found SSMS very flaky in this regard, almost every script it generated had to be tweaked manually for this or that, even when generating for the same version of SQL as the SSMS.
I'd recommend using Toad for SQL for this. Still not perfect, but much better - errors are rare, the checkboxes to flip most of the options are in a collapsible pane above the script, the script is in a full code pane and not in a card-sized editbox, and there's even a button to copy the whole script into an editor page. And you don't have to go through a series of right and left clicks to get to it, it's in the rightmost page when viewing a table (other pages are table properties, columns, browse, statistics etc).