SQLTeam.com | Weblogs | Forums

Simplify a database table

how do i simplify this kind of tables in sql

create table table1(tb1ID int not null identity(1,1) primary key
   ,name varchar(50) 
   ,BSUN1 varchar(50)
   ,BSUN2 varchar(50)
   ,BSUN3 varchar(50)
   ,BSUN4 varchar(50)
   ,BSUN5 varchar(50)
   )

can I use just single variable for BSUN and Component? if so then how would I insert value and (select then populate multiple textboxes from DB) ...my friend mentioned using array but I have very limited knowledge in array, so anyone can help me with this? .

create table table1(
   name varchar(50) NOT NULL
   ,sequence_number smallint NOT NULL /*1, 2, 3, 4, 5, ...*/
   ,BSUN varchar(50) NULL
   ,PRIMARY KEY ( name, sequence_number )
   )
1 Like