Link to home
Start Free TrialLog in
Avatar of Richardsoet
Richardsoet

asked on

sql sCRIPT

I HAVE AN EXISTING TABLE IN SQL 2000 DATABASE, THE TABLE IS SHOWN BELOW
CREATE TABLE BKDEBTP (
  BKGDSW  CHAR     (6)      NOT NULL,
  BKIQNE  NUMERIC  (9)      NOT NULL,
  BKIRNE  NUMERIC  (9)      NOT NULL,
  BKISNE  NUMERIC  (3)      NOT NULL,
  BKOETA  CHAR     (40)     NOT NULL,
  BKLRSW  CHAR     (1)      NOT NULL,
  BKACVH  VARCHAR  (32)             ,
  BKAAVC  VARCHAR  (32)             ,
  BKAAVH  VARCHAR  (32)             ,
  BKABVH  VARCHAR  (32)             ,
  BKUFCG  CHAR     (10)     NOT NULL ) ON [Data]

ALTER TABLE BKDEBTP ADD CONSTRAINT BKDEBTP_PK PRIMARY KEY (
  BKGDSW,
  BKIQNE)

WHEN I TRY TO MODIFY ONE OF THE COLUMN AS SHOWN BELOW TO HAVE NOT NULL SET ON BKAAVC

ALTER TABLE BKDEBTP
ADD BKAAVC VARCHAR(216) NOT NULL DEFAULT ''

I WAS GETTING THE BELOW ERROR

Server: Msg 2705, Level 16, State 4, Line 1
Column names in each table must be unique. Column name 'BKAAVC' in table 'BKDEBTP' is specified more than once.

PLEASE REWRITE THE SCRIPT FOR ME SO THAT I CAN SET THE COLUMN BKAAVC TO NOT NULL

ASKER CERTIFIED SOLUTION
Avatar of puranik_p
puranik_p
Flag of India image

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
Avatar of r_a_j_e_s_h
r_a_j_e_s_h

ALTER TABLE BKDEBTP Alter column BKAAVC VARCHAR(216) NOT NULL
Avatar of Anthony Perkins
For the record this questioner has failed to close one single question.
@acperkins,
Thanks for pointing this out.

@r_a_j_e_s_h,
what's the idea of repeating my comment?
I recommend: Accept puranik_p
Richardsoet,
You have obviouslt chosen a duplicate post as answer.

I've put a request at CS for review.
https://www.experts-exchange.com/questions/21447842/another-one.html

and dear r_a_j_e_s_h,
let me know when you plan to quit the habit of duplicating posts.