3 added 4 characters in body
source | link

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose the all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc). 

There's also a 'Script for Server Version' option, which allows you to choose which version of SQL you're scripting for.

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose the all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc). There's also a 'Script for Server Version' option, which allows you to choose which version of SQL you're scripting for.

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose the all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc). 

There's also a 'Script for Server Version' option, which allows you to choose which version of SQL you're scripting for.

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here

2 Mentioned the 'Script for Server Version' option as it's part of the asker's requirement.
source | link

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose the all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc). There's also a 'Script for Server Version' option, which allows you to choose which version of SQL you're scripting for.

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc).

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose the all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc). There's also a 'Script for Server Version' option, which allows you to choose which version of SQL you're scripting for.

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here

1
source | link

You're using the correct method, you're just not setting all the right options.

Go through the Tasks > Generate scripts wizard again, there are steps in there where you can choose all object types, and other places where you can choose what properties of those objects to include (permissions, indexes, etc).

If your database is small enough, you can even include data in that script. If not, you'll have to create the empty database container, and then using SSIS or something to pipe all the data over.

One more option: you can create an SSIS package and use the "Transfer SQL Server Objects Task" type to do the same thing, it should have all the same options:

enter image description here