Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
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.
Reply With Quote
  #2 (permalink)  
Old March 14th, 2008, 07:42 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Hudson, MA, USA.
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
je.mason@comcast.net
Reply With Quote
  #3 (permalink)  
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.
Reply With Quote
  #4 (permalink)  
Old March 17th, 2008, 09:16 PM
Friend of Wrox
Points: 2,101, Level: 18
Points: 2,101, Level: 18 Points: 2,101, Level: 18 Points: 2,101, Level: 18
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2003
Location: , , .
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

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

Reply With Quote
  #5 (permalink)  
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.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 03:58 AM.


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