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 ' ';
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 ' ';
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]
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABP3CG] DEFAULT (' ') FOR [ABP3CG]
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABMRTA] DEFAULT (' ') FOR [ABMRTA]
ASKER
could you please tell me where DF_ is coming from is it default by SQL 2000
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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;
/
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
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABMRTA] DEFAULT ' ' FOR [ABMRTA]