Showing posts with label Database. Show all posts
Showing posts with label Database. Show all posts

Sunday, May 27, 2012

SQL Server Tips

1. How to get list of stored procedures in a database

SELECT NAME FROM SYS.ALL_OBJECTS WHERE type= 'P'


2. How to get list of tables in a database

SELECT * from sysobjects where type = 'U'


3. How to get list of databases in a SQL server

SELECT name, collation_name
FROM sys.databases
WHERE name NOT IN ('master', 'tempdb', 'model', 'msdb')