Search code examples
sqlsql-serversql-server-2008sqlcmd

Is there any way to generate database scripts from a SQL query in SQL Server?


I need to dump the database structure for a SQL Server database, but I need to do it from a SQL query or sqlcmd script.

Is there a valid way to do it?

Thanks


Solution

  • Follow the complete steps to generate script with data.

    1 enter image description here

    2 enter image description here

    3

    enter image description here

    4

    enter image description here

    5

    enter image description here