DATA oluşum scripti (tüm tablolar dahil)

Post Reply
ahmet
Site Admin
Posts: 66
Joined: Tue Feb 23, 2021 6:54 pm

DATA oluşum scripti (tüm tablolar dahil)

Post by ahmet »

Generate Database Script in SQL Server

Step 1

Open SQL Server 2008 and select the database that you want to generate the script for. In my case, I have selected the "BlogDb" database.

Generate Database Script in SQL Server

Step 2

Now right-click the database then Tasks->Generate scripts.

Generate Database Script in SQL Server

Step 3

After that a window will open. Select the database and always check "script all objects in the selected database". It will generate a script for all the tables, sp, views, functions and anything in that database.

Generate Database Script in SQL Server

Step 4

After that, under "Table View Options" make true "Script data". So the table's data in the database will also be created. After that click "Next".

Generate Database Script in SQL Server

Step 5

In this window, you will get the options for where you want to publish your database script.

By default, it will be "New query window". You can save the script file also by checking "script to file". After that click the "Next" button.

Generate Database Script in SQL Server

Step 6

Click Finish Button.

Generate Database Script in SQL Server

Step 7

After clicking the Finish button you will see a window like the following window.

Generate Database Script in SQL Server

Step 8

After successfully converting the scripts you will see the following window. Press the close button.

Generate Database Script in SQL Server

Step 9

See in the following figure the script has been generated with the table with inserted data query also generated because while generating the script we select the Dropdownlist "script data= true"

Generate Database Script in SQL Server

Conclusion

So in this article, we have seen how to generate a database script with all its object and data.
Post Reply