Getting Help from SQL Server

help-wanted

Sometimes, when using any software, you need a little help in remembering a command or step-by-step instructions on how to perform a task. SQL Server provides a little help in understanding objects in the database with the sp_Help command. This can be helpful if you see an object referenced in a stored procedure or view, and want to get a quick list of information about that object.

sp_help  @objname =  ‘name’

Example:

sp_help  <- this lists all the objects in the currently selected database

sp_help ‘mytable’  <- this lists all the known information about this specific object

You can get more information about this command here.

You can also get a quick list of database information, showing all the databases on the current instance, using the sp_helpdb command.

sp_helpdb @dbname=  ‘name’

Example:

sp_helpdb  <- this lists all the databases in the current instance

sp_helpdb ‘mydatabase’  <- this lists all the known information about this specific database

You can get more information about this command here.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s