Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2008, 04:50 AM
jomet
Guest
 
Posts: n/a
Default List Default value

Hi,

How can i list default values associated with tables?
in sql 2000
Advance thanks


jomet.
---------------------------------------------
Once you start a working on something,
dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
 
Old March 14th, 2008, 07:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 839
Thanks: 0
Thanked 1 Time in 1 Post
Default

The INFORMATION_SCHEMA.COLUMNS view has a column in it named COLUMN_DEFAULT which contains the DEFAULT expression assigned to a table columnn, if any.

Jeff Mason
[email protected]
 
Old March 14th, 2008, 10:25 PM
jomet
Guest
 
Posts: n/a
Default

thanks,
I solved it.

jomet.
---------------------------------------------
Once you start a working on something,
dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.
 
Old March 17th, 2008, 09:16 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

How did you solve it? I'd really like to know.

 
Old March 17th, 2008, 10:21 PM
jomet
Guest
 
Posts: n/a
Default

Hi Richard,

I solved using this query

SELECT C_OBJ.NAME AS CONSTRAINT_NAME, COM.TEXT AS DESCRIPTION
FROM SYSOBJECTS C_OBJ, SYSOBJECTS T_OBJ, SYSCOMMENTS COM
WHERE T_OBJ.ID = C_OBJ.PARENT_OBJ
    AND C_OBJ.ID = COM.ID
    AND C_OBJ.XTYPE = 'D'
    AND T_OBJ.NAME='Your_tableName'

if you have any doubt in it, let me know
if u find some better query
please inform me also:)

jomet.
---------------------------------------------
Once you start a working on something,
dont be afraid of failure and dont abandon it.
People who work sincerely are the happiest.





Similar Threads
Thread Thread Starter Forum Replies Last Post
multi-column list box values moved to 2nd list box sbmvr Access VBA 1 May 14th, 2007 01:58 PM
Limiting a combo box to default list hamffjs Excel VBA 1 July 17th, 2006 03:19 PM
fill dropdown list with items when parent list isaac_cm Pro PHP 1 July 10th, 2006 05:41 AM
List tablesname from database & list databasename ittorget MySQL 3 September 10th, 2005 03:06 AM
select a default value in a drop-down list crmpicco HTML Code Clinic 2 January 20th, 2005 08:23 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.