Chapter II.5. Looking After Your Tables

With your database and all related tables created, you might think it's time to sit back, relax, and put your feet up on the desk: Everything is on autopilot from here. Perhaps you're right; everything might be fine in your world. However, reality rarely plays out this way. There's a good chance that you'll periodically need to modify some tables. It's also likely that you'll need to delete a table from time to time. If nothing else, you'll at least want to get a comprehensive list of all the tables in your database.

This chapter is about taking good care of your tables after you've created them. To begin, we show you how to get a list of all the tables present in a database, view their data, and make sense of the details about each one. This is where you see how to determine whether there are any dependencies to consider. After you have a list of all your tables, you find out how to view and understand the characteristics of a given table. Next, we walk you through the often-necessary task of deleting a table. Finally, because you may be more of a command-line administrator, we show you how to achieve all these tasks by using the SQLCMD utility.

Get Microsoft® SQL Server™ 2008 All-In-One Desk Reference For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.