Getting Object Information

Here is a handy little script for running in Management Studio or the like:

USE [databasename]

DECLARE @theobj SYSNAME
SET @theobj = '[schemaname].[objectname]'

EXEC sp_help @theobj

EXEC sp_helptext @theobj

Just replace the names in square brackets with what you are interested in but don't remove the square brackets. Note that the last line sp_helptext only works with code based objects like stored procedures and not tables.