Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies®
by Robert D. Schneider, Darril Gibson
VIII.1.3. Generating Configuration Scripts
Microsoft subscribes to the database administration philosophy that wizards and graphical tools are good, and repetitive, tedious hand coding is bad. Despite this natural preference toward wizard-driven automation, circumstances still exist where database administrators might need to create or modify scripts that manage their databases. Some DBAs even prefer to work this way, rather than always using graphical tools. For this important constituency, SQL Server makes it easy to generate, and then edit, all kinds of administrative scripts. We close this chapter by seeing how this is done.
To get started, launch the SQL Server Management Studio. You'll soon be in an excellent position to generate all the scripts you need. Here's how:
Launch SQL Server Management Studio.
Connect to the appropriate SQL Server instance.
Expand the connection's entry in the Object Explorer view.
Expand the Databases folder.
Right-click the database that you want to administer.
Choose Tasks.
Choose Generate Scripts.
This launches the Generate SQL Server Scripts Wizard. For the purpose of this example, we show you how to generate a simple script that creates a table. When you start to use this wizard, however, you can do much more.
Highlight the database where the object(s) that you want to script can be found, and click Next.
Customize the script options that you want an SQL Server to employ, and click Next.
More than two dozen ways to tweak your script exist, ranging ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access