Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create "Script Generator Options" scripts in SQL Server?

I have a SQL Server database and whenever I want to make a backup of the database, first generate a Drop and Create Script of the DB. Because by this way I can make my database in every version of SQL Server. Regardless of the version and maintenance problems of SQL.

In the Generate and Publish Scripts window of SQL Server there is an Advanced Scripting Option, as shown below:

Advanced Scripting Options

Now, I would like a script from this window to reproduce script generator advanced options. In the other words, I want a script to make script generator of my database by my selected Advanced Options.

How can I do it?

like image 634
Behzad Avatar asked Sep 01 '25 17:09

Behzad


1 Answers

You can use SQL Server Profiler to retrieve executing sqls in the specified instance.

[How to see executing batch sqls in the specified instance][1]

like image 197
Hossein POURAKBAR Avatar answered Sep 04 '25 14:09

Hossein POURAKBAR