Learn how to a build a cloud-first strategyRegister Now

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

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

0
Richardsoet
Asked:
Richardsoet
  • 4
1 Solution
 
puranik_pCommented:
ALTER TABLE BKDEBTP
ALTER COLUMN BKAAVC VARCHAR(216) NOT NULL
0
 
r_a_j_e_s_hCommented:
ALTER TABLE BKDEBTP Alter column BKAAVC VARCHAR(216) NOT NULL
0
 
Anthony PerkinsCommented:
For the record this questioner has failed to close one single question.
0
Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

 
puranik_pCommented:
@acperkins,
Thanks for pointing this out.

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

I've put a request at CS for review.
http://www.experts-exchange.com/Community_Support/Q_21447842.html

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

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

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