Custom Search
www.rocket99.com : Technical Guides Sybase Oracle UNIX Javascript


Technical Guides
Sybase
Oracle
UNIX
Javascript




After Work

Highlife Adventures
The best club in Chicago
for Chicago Singles is Highlife Adventures!






Kyoto Sushi
in Chicago, on Lincoln Ave.
Moody's Pub
in Chicago, has great burgers
Skylark
in Chicago, on Halsted .. excellent beer selection!


Sybase » DDL » Coding »

Binding Rules to Colunms

     




Default values for colunms can be specified at the time a table is created, or
afterwards via the modify command.



/* Employee will have a default salary of 10000, and a hire date of today */

create table employee (
emp_id integer not null,
salary money default 0,
hire_dt datetime default getdate()
)
go

/* alter the table, so salary starts at 49000 */

ALTER TABLE employee REPLACE salary DEFAULT 49000
go


/* create a new default; bind the column to your custom default */


create default def_highsal as 55000
go
sp_bindefault def_highsal,'employee.salary'
go


-- creating your own custom defaults has a significant advantage:
-- you can actually choose the name of the default.














Sybase : Related Topics


Sybase Web Site
Sybase Mobile Web Site
Oracle Web Site





Site Index About this Guide to Sybase, Oracle, and UNIX Contact Us Advertise on this site




Copyright © 2010 Stoltenbar Inc All Rights Reserved.