I am searching to convert a entire database into a text file and access the file via a windows form application. If it's possible then help me how to make it.
-
1You can create the database script, then you can convert it into text file and open in any text editor. – Aakash Singh Aug 28 '19 at 05:36
-
1Possible duplicate of [How to get script of SQL Server data?](https://stackoverflow.com/questions/2321052/how-to-get-script-of-sql-server-data) – Jeremy Thompson Aug 28 '19 at 05:46
-
A database generally has multiple tables. Do you propose turning multiple tables into a single file? How is that going to work? What is the purpose of what you are doing? – Nick.Mc Aug 28 '19 at 05:52
1 Answers
You can use Generate Script option in SQL Management studio to generate script for selected objects. There are option to make script of 'schema only' or 'data only' or 'both'.
Step 1: Right click on your database then navigate to task >> Generate Script
Step 3: Since you want to generate script for whole database. so default option is ok. Otherwise you may select the particular database objects.
Step 4: Select appropriate option from advanced popup.
Step 5: Click next and your database script is generated as your selected option.
Please find this link for detail steps for generating script in SQL Server Generate Scripts.
There you find your option to save generated script in query window
or clipboard
or 'sql file`. Which further open in text editor for further use.

- 3,843
- 1
- 10
- 27