Cleaning Up the Instance


The instance and applications we created in this chapter really don't do anything useful, but they were helpful in allowing us to examine the various parts of the system. You really won't need to work with this instance and its applications after this chapter, so you can use the following steps to remove them from your system. This cleans up the databases, Registry keys, and settings associated with the instances.

Much like the instance creation steps, two of these operations are implemented as batch files that invoke nscontrol commands. These commands delete and unregister the instance. Deleting removes the database, and unregistering removes the Registry keys and performance counters and uninstalls the Windows service associated with the instance.

I won't explain them in detail here, but it's worth taking a moment to look inside the batch files referenced in the following steps to see what they are doing. (They're fairly self-explanatory.)

Note

The equivalent operations are also available in Management Studio, via the context menus on the instances in the Notification Services folder in the Object Explorer. Because these are used in much the same way as the other Management Studio tools already covered, I have not provided a detailed explanation of them here.


1.

Open a Notification Services Command Prompt on your development machine and navigate to the scripts directory for this chapter's sample by typing the following command:

 cd /d C:\SQL-NS\Samples\MinimalMultiApplication\Scripts 


2.

Stop the service by typing the following command:

 net stop NS$MinimalMultiApplication 


3.

Close any Management Studio query windows you still have connected to the instance's database.

4.

Run delete.cmd. If you're using SQL Server Authentication, the script will prompt you for the SQL username and password for the development account you created in Chapter 2. If you're using Windows Authentication, you will not be prompted.

5.

Run unregister.cmd.




Microsoft SQL Server 2005 Notification Services
Microsoft SQL Server 2005 Notification Services
ISBN: 0672327791
EAN: 2147483647
Year: 2006
Pages: 166
Authors: Shyam Pather

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net