Link to home
Start Free TrialLog in
Avatar of Richardsoet
Richardsoet

asked on

SQL

i have got a table below

CREATE TABLE ABDEBTP (
  ABP3CG  CHAR          (10)     NOT NULL,
  ABMRTA  CHAR          (40)     NOT NULL ) ON [Data]


please help , i want to modify the columns on the  existing  table   above to be like the below


CREATE TABLE ABDEBTP (
    ABP3CG  CHAR     (10)      DEFAULT ' ' NOT NULL,
    ABMRTA  CHAR     (40)      DEFAULT ' ' NOT NULL) ON [DATA]


please helpme write the script
the script below is for oracle ,please help me write one for SQL 2000


ALTER TABLE ABDEBTP MODIFY ABP3CG DEFAULT ' ';

ALTER TABLE ABDEBTP MODIFY ABMRTA DEFAULT ' ';
Avatar of mokule
mokule
Flag of Poland image

ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABP3CG] DEFAULT ' ' FOR [ABP3CG]
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABMRTA] DEFAULT ' ' FOR [ABMRTA]
Better in paranthesis
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABP3CG] DEFAULT (' ') FOR [ABP3CG]
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABMRTA] DEFAULT (' ') FOR [ABMRTA]
Avatar of Richardsoet
Richardsoet

ASKER

could you please tell me where DF_ is coming from is it default by SQL 2000
ASKER CERTIFIED SOLUTION
Avatar of Mannaraprayil
Mannaraprayil

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks , could you please help me convert the below oracle trigger to sql trigger


PROMPT  TRIGGER FA_Trigger:
create sequence fa_seq;
 
create or replace trigger fa_trigger before insert on fadebtp for each row
begin
if ( :new.faeyne is null ) then
select fa_seq.nextval into :new.faeyne from dual;
end if;
end;
/
Sorry, but it is completely new question