Home > Archive > MS SQL Server > January 2006 > view sql default for table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author view sql default for table
drewmania001@gmail.com

2006-01-30, 3:23 am

i'd like to grab all the defaults from a specific table but have no
idea how to do it!
i've been using sp_columns but its bringing back way to much info for
me

what i'd like is to bring back the column name and its corresponding
default...can this be done?

any help in the right direction would be much appreciated, cheers!

Razvan Socol

2006-01-30, 3:23 am

Use something like this:

SELECT COLUMN_NAME, COLUMN_DEFAULT
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='YourTabl
e'

Razvan

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com