Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Location
    india
    Posts
    67

    Unanswered: default a column

    Hi all,

    Please tell me the syntax to do the following

    Alter Table <table_name>
    Modfiy column<column_name> add default 60

    How do i write a script in sybase.

    thanks

  2. #2
    Join Date
    Jan 2012
    Location
    Lisbon
    Posts
    115
    Provided Answers: 1
    Hi,
    Try this:

    ALTER TABLE <Tablename> REPLACE <columnname> DEFAULT <value>

    Ex:
    create table Example (
    a int,
    b varchar(30)
    )

    ALTER TABLE dbo.Example REPLACE b DEFAULT 'BBBB'

    insert into Example(a) values (1)

    select * from Example

    drop table Example


    Cheers
    Last edited by Catarrunas; 07-18-12 at 05:55.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •