I have a user (non sysadmin) that needs to query the default value of a column. This was previously possible in sql 2000. Using the query attached.
In 2005 running the same query returns a value of NULL. Is it possible for a non-sysadmin to run a query to determine the default value and if possible the query compatible with 2000 and 2005?
SELECT table_name, column_name, LEFT(is_nullable,1)
,CAST(ISNULL((CAST(numeric_precision AS VARCHAR))
, character_maximum_length) AS VARCHAR) as max_length
FROM information_schema.columns WHERE table_name = ?