View Single Post
  #3 (permalink)  
Old December 14th, 2005, 03:37 PM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Go into MS SQL Query Analyzer, log into your favorite MSSQL DB, then enter "sp_help" in the query window (with the default install of the analyzer you can also hit ALT-F1 as a shortcut). You'll see a list of all the objects in the database. When on the 'master' DB you'll see all the master objects such as stored procedures used for system administration tasks.

Among those sprocs are these two:
sp_addlogin
sp_adduser

Those look like they may be part of what you need. A little more exploring around the SP_HELP list should find you some more.

A couple more helpful hints on some built in sprocs:
'sp_help' will show you the schema details of an object. Example:
    sp_help MyTable
    sp_help MyStoredProcedure
'sp_helptext' will show the text of a stored procedure. Example:
    sp_helptext MyStoredProcedure
    sp_helptext sp_helptext

You can highlite a db object name (table, sproc) and hit ALT-F1 and it will display the object's schema. If you work with sprocs a lot, you can add a similar shortbut by going to Tools->Customize and adding "sp_helptext" to one of the empty shortcut keys. Then you can highlite a sproc name and just hit the shortcut key to see the text of the sproc.

-Peter
Reply With Quote