dbTalk Databases Forums  

Retriving Default Values

comp.databases.sybase comp.databases.sybase


Discuss Retriving Default Values in the comp.databases.sybase forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jim
 
Posts: n/a

Default Retriving Default Values - 01-13-2004 , 07:31 AM






Is there a way to retrieve the value associated with a default object in 11.92.

Something like:

create default dbo.def_person as 1
go

declare @def_person_id numeric(6)

select @def_person_id = value from syssometable where name='def_person'

Thanks in advance

Jim

Reply With Quote
  #2  
Old   
Rob Verschoor
 
Posts: n/a

Default Re: Retriving Default Values - 01-13-2004 , 12:43 PM






"Jim" <james.wright (AT) ubsw (DOT) com> wrote

Quote:
Is there a way to retrieve the value associated with a default
object in 11.92.

Something like:

create default dbo.def_person as 1
go

declare @def_person_id numeric(6)

select @def_person_id = value from syssometable where
name='def_person'

Thanks in advance

Jim

You can query syscomments and extract the default value from there.
Keep in mind however, that line breaks in the original 'create
default' statement will be preserved in syscomments (so don't expect
it to be a single text string without newlines).

HTH,

Rob
-------------------------------------------------------------
Rob Verschoor

Certified Sybase Professional DBA for ASE 12.5/12.0/11.5/11.0
and Replication Server 12.5

Author of "Tips, Tricks & Recipes for Sybase ASE" and
"The Complete Sybase ASE Quick Reference Guide"
Online orders accepted at http://www.sypron.nl/shop

mailto:rob (AT) YOUR (DOT) SPAM.sypron.nl.NOT.FOR.ME
http://www.sypron.nl
Sypron B.V., P.O.Box 10695, 2501HR Den Haag, The Netherlands
-------------------------------------------------------------



Reply With Quote
Reply




Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.