This t-sql query will list names of sql objects and its type:

SELECT
name,
CASE WHEN type='P' THEN
'Stored Procedure'
ELSE
CASE WHEN type='TR' THEN
'Trigger'
ELSE CASE WHEN type='V' THEN
'View'
ELSE CASE WHEN type='U' THEN
'Table'
ELSE CASE WHEN type='FN' THEN
'Function'
ELSE CASE WHEN type='F' THEN
'Foregin Key'
ELSE CASE WHEN type='K' THEN
'Key'
END
END
END
END
END
END
END
FROM
sysObjects
WHERE
type='P' or type='TR' or type='V' or type='U' or type='FN' or type='F' or type='K'
ORDER BY
type, name

VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. MSSQL: Query to display objects in a database #2
  2. What is the difference between CAST and CONVERT in SQL?
  3. Build DateTime from values
  4. SQL Query and DOTNET?
  5. What is the maximum size MSSQL and MySQL can support?