How can I export scripts to create the nonsystem tables and stored procedures of a Microsoft SQL Server database?
SQL Server has an option that lets you create scripts for database creation, including designing tables and stored procedures. To access this feature, perform these steps:
- Start the Enterprise Manager (Start, Programs, Microsoft SQL Server, Enterprise Manager).
- Expand Microsoft SQL Servers, SQL Server Group (local) (Windows NT), Databases.
- Right-click the desired database and select All Tasks, Generate SQL Script, as Figure 1 shows.
- Under the General tab, click the Show All button and select the All tables and All stored procedures checkboxes shows.
- Click OK.
- You'll be prompted for the name of a SQL extension file to save the content to and click Save.
- Click OK at the completion dialog box.
The file that this process generates will contain the SQL code necessary to create the objects selected.