Thursday, October 04, 2007 - Posts

ISNULL() or COALESCE()?
04 October 07 12:44 PM | Madhivanan | 2 Comments   
Both the functions are used to show/assign different value if the parameter is null. select isnull(null,'test'),coalesce(null,'test') But there are diiferences between the two isnull() is sql server specific The datatype/length of the result depends on Read More...
Show text from sql_handle
04 October 07 03:50 AM | SQL Master | 2 Comments   
Based upon the query or stored procedure execution the plan will be stored in the cache, but it may not be in readable format as it is stored in Hexadecimal when you simply query SYSPROCESSES table. So in order to extract the query plan that is in cache, 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...