Browse by Tags

TSQL to get clustered index information in SQL Server 2005
10 March 08 01:00 AM | SQL Master | 3 Comments   
Recently within a supportal case with CSS we have been given the following TSQL to get information on indexes, where I have modified a bit to get 'Clustered' index information alone that was helpful to see which tables lack of clustered index alone. declare Read More...
Different ways to know structure of a table
28 February 08 01:51 AM | Madhivanan | 3 Comments   
You can use one of the following to know the structure of a table 1 Generate SQL Script option from Enterprise Manager/Management Studio 2 select * from information_schema.columns where table_name='table_name' 3 EXEC sp_help 'table_name' 4 EXEC sp_columns Read More...
How do I find the parameters for a specified stored procedure or function?
10 December 07 04:21 PM | SQL Master | 2 Comments   
USE < database_name >; GO SELECT SCHEMA_NAME ( schema_id ) AS schema_name , o . name AS object_name , o . type_desc , p . parameter_id , p . name AS parameter_name , TYPE_NAME ( p . user_type_id ) AS parameter_type , p . max_length , p . precision Read More...
How to find all the owners of entities contained in a specified schema?
04 October 07 01:00 AM | SQL Master | 2 Comments   
How to find all the owners of entities contained in a specified schema? USE <database_name>; GO SELECT 'OBJECT' AS entity_type ,USER_NAME(OBJECTPROPERTY(object_id, 'OwnerId')) AS owner_name ,name FROM sys.objects WHERE SCHEMA_NAME(schema_id) = '<schema_name>' Read More...
Enhancement to OBJECT_NAME metadata function and a new OBJECT_SCHEMA_NAME metadata function
16 July 07 01:53 AM | SQL Master | 1 Comments   
You may be aware OBJECT_NAME function can be use to return the database object name, I think since SQL 2000 when system functions are used the parameter of a system function is optional, the current database, host computer, server user, or database user Read More...