[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 238
  • Last Modified:

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 ' ';
0
Richardsoet
Asked:
Richardsoet
  • 3
  • 2
1 Solution
 
mokuleCommented:
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABP3CG] DEFAULT ' ' FOR [ABP3CG]
ALTER TABLE ABDEBTP ADD CONSTRAINT [DF_ABDEBTP_ABMRTA] DEFAULT ' ' FOR [ABMRTA]
0
 
mokuleCommented:
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]
0
 
RichardsoetAuthor Commented:
could you please tell me where DF_ is coming from is it default by SQL 2000
0
NEW Veeam Backup for Microsoft Office 365 1.5

With Office 365, it’s your data and your responsibility to protect it. NEW Veeam Backup for Microsoft Office 365 eliminates the risk of losing access to your Office 365 data.

 
MannaraprayilCommented:
DF_ABDEBTP_ABP3CG is a name just gived for the constraint
0
 
RichardsoetAuthor Commented:
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;
/
0
 
mokuleCommented:
Sorry, but it is completely new question
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now